Random utilities. More...
#include <XrdClUtils.hh>
Public Types | |
| enum | AddressType { IPAuto = 0, IPAll = 1, IPv6 = 2, IPv4 = 3, IPv4Mapped6 = 4 } |
Address type. More... | |
Static Public Member Functions | |
| template<class Container > | |
| static void | splitString (Container &result, const std::string &input, const std::string &delimiter) |
| Split a string. | |
| static int | GetIntParameter (const URL &url, const std::string &name, int defaultVal) |
| Get a parameter either from the environment or URL. | |
| static std::string | GetStringParameter (const URL &url, const std::string &name, const std::string &defaultVal) |
| Get a parameter either from the environment or URL. | |
| static AddressType | String2AddressType (const std::string &addressType) |
| Interpret a string as address type, default to IPAll. | |
| static Status | GetHostAddresses (std::vector< XrdNetAddr > &addresses, const URL &url, AddressType type) |
| Resolve IP addresses. | |
| static void | LogHostAddresses (Log *log, uint64_t type, const std::string &hostId, std::vector< XrdNetAddr > &addresses) |
| Log all the addresses on the list. | |
| static std::string | TimeToString (time_t timestamp) |
| Convert timestamp to a string. | |
| static uint64_t | GetElapsedMicroSecs (timeval start, timeval end) |
| Get the elapsed microseconds between two timevals. | |
| static XRootDStatus | GetRemoteCheckSum (std::string &checkSum, const std::string &checkSumType, const std::string &server, const std::string &path) |
| Get a checksum from a remote xrootd server. | |
| static XRootDStatus | GetLocalCheckSum (std::string &checkSum, const std::string &checkSumType, const std::string &path) |
| Get a checksum from local file. | |
| static std::string | BytesToString (uint64_t bytes) |
| Convert bytes to a human readable string. | |
| static XRootDStatus | CheckTPC (const std::string &server, uint16_t timeout=0) |
| Check if peer supports tpc. | |
| static XRootDStatus | CheckTPCLite (const std::string &server, uint16_t timeout=0) |
| static std::string | FQDNToCC (const std::string &fqdn) |
| Convert the fully qualified host name to country code. | |
| static Status | GetDirectoryEntries (std::vector< std::string > &entries, const std::string &path) |
| Get directory entries. | |
| static Status | ProcessConfig (std::map< std::string, std::string > &config, const std::string &file) |
| Process a config file and return key-value pairs. | |
| static void | Trim (std::string &str) |
| Trim a string. | |
| static void | LogPropertyList (Log *log, uint64_t topic, const char *format, const PropertyList &list) |
| Log property list. | |
| static std::string | Char2Hex (uint8_t *array, uint16_t size) |
| Print a char array as hex. | |
| static std::string | NormalizeChecksum (const std::string &name, const std::string &checksum) |
| Normalize checksum. | |
| static std::vector< std::string > | GetSupportedCheckSums (const XrdCl::URL &url) |
| Get supported checksum types for given URL. | |
| static std::string | InferChecksumType (const XrdCl::URL &source, const XrdCl::URL &destination, bool zip=false) |
Random utilities.
| static std::string XrdCl::Utils::BytesToString | ( | uint64_t | bytes | ) | [static] |
Convert bytes to a human readable string.
| static std::string XrdCl::Utils::Char2Hex | ( | uint8_t * | array, | |
| uint16_t | size | |||
| ) | [static] |
Print a char array as hex.
| static XRootDStatus XrdCl::Utils::CheckTPC | ( | const std::string & | server, | |
| uint16_t | timeout = 0 | |||
| ) | [static] |
Check if peer supports tpc.
| static XRootDStatus XrdCl::Utils::CheckTPCLite | ( | const std::string & | server, | |
| uint16_t | timeout = 0 | |||
| ) | [static] |
| static std::string XrdCl::Utils::FQDNToCC | ( | const std::string & | fqdn | ) | [static] |
Convert the fully qualified host name to country code.
| static Status XrdCl::Utils::GetDirectoryEntries | ( | std::vector< std::string > & | entries, | |
| const std::string & | path | |||
| ) | [static] |
Get directory entries.
| static uint64_t XrdCl::Utils::GetElapsedMicroSecs | ( | timeval | start, | |
| timeval | end | |||
| ) | [static] |
Get the elapsed microseconds between two timevals.
| static Status XrdCl::Utils::GetHostAddresses | ( | std::vector< XrdNetAddr > & | addresses, | |
| const URL & | url, | |||
| AddressType | type | |||
| ) | [static] |
Resolve IP addresses.
| static int XrdCl::Utils::GetIntParameter | ( | const URL & | url, | |
| const std::string & | name, | |||
| int | defaultVal | |||
| ) | [static] |
Get a parameter either from the environment or URL.
| static XRootDStatus XrdCl::Utils::GetLocalCheckSum | ( | std::string & | checkSum, | |
| const std::string & | checkSumType, | |||
| const std::string & | path | |||
| ) | [static] |
Get a checksum from local file.
| static XRootDStatus XrdCl::Utils::GetRemoteCheckSum | ( | std::string & | checkSum, | |
| const std::string & | checkSumType, | |||
| const std::string & | server, | |||
| const std::string & | path | |||
| ) | [static] |
Get a checksum from a remote xrootd server.
| static std::string XrdCl::Utils::GetStringParameter | ( | const URL & | url, | |
| const std::string & | name, | |||
| const std::string & | defaultVal | |||
| ) | [static] |
Get a parameter either from the environment or URL.
| static std::vector<std::string> XrdCl::Utils::GetSupportedCheckSums | ( | const XrdCl::URL & | url | ) | [static] |
Get supported checksum types for given URL.
| static std::string XrdCl::Utils::InferChecksumType | ( | const XrdCl::URL & | source, | |
| const XrdCl::URL & | destination, | |||
| bool | zip = false | |||
| ) | [static] |
| static void XrdCl::Utils::LogHostAddresses | ( | Log * | log, | |
| uint64_t | type, | |||
| const std::string & | hostId, | |||
| std::vector< XrdNetAddr > & | addresses | |||
| ) | [static] |
Log all the addresses on the list.
| static void XrdCl::Utils::LogPropertyList | ( | Log * | log, | |
| uint64_t | topic, | |||
| const char * | format, | |||
| const PropertyList & | list | |||
| ) | [static] |
Log property list.
| static std::string XrdCl::Utils::NormalizeChecksum | ( | const std::string & | name, | |
| const std::string & | checksum | |||
| ) | [static] |
Normalize checksum.
| static Status XrdCl::Utils::ProcessConfig | ( | std::map< std::string, std::string > & | config, | |
| const std::string & | file | |||
| ) | [static] |
Process a config file and return key-value pairs.
| static void XrdCl::Utils::splitString | ( | Container & | result, | |
| const std::string & | input, | |||
| const std::string & | delimiter | |||
| ) | [inline, static] |
Split a string.
| static AddressType XrdCl::Utils::String2AddressType | ( | const std::string & | addressType | ) | [static] |
Interpret a string as address type, default to IPAll.
| static std::string XrdCl::Utils::TimeToString | ( | time_t | timestamp | ) | [static] |
Convert timestamp to a string.
| static void XrdCl::Utils::Trim | ( | std::string & | str | ) | [static] |
Trim a string.
1.6.1