Namespaces | |
Logging | |
The fc::Logging namespace contains helper functions to easily manage the different types of logging available in FC++. | |
SummaryLog | |
The SummaryLog namespace contains helper functions for generating a summary of what happens within FC++. | |
Classes | |
class | Control |
class | Exception |
fc::Exception objects represent a C++ exception and usually includes stack traces and optional parameters to describe the internal state of FC++ at the time the exception happened. More... | |
struct | FileDetails |
A collection of file or directory properties returned when a directory listing has been requested. More... | |
class | GlobalStateAndStats |
Combine both state and statistics into a single class which callers can access. More... | |
class | GlobalStats |
GlobalStats is used to track some summary statistics during file transfers. More... | |
class | Local |
The class fc::Local is used to encapsulate local directories or files. More... | |
class | Name |
To prevent mixing up local path and remote path parameters when calling the FC++ API, the path and/or filenames are wrapped using the simple fc::Local and fc::Remote classes. More... | |
class | Options |
fc::Options contains all the default and user-defined settings required by fc::Control to connect to FTP servers. More... | |
class | Remote |
The class fc::Remote is used to encapsulate remote directories or files. More... | |
class | TransferStats |
File transfer statistics. More... | |
Typedefs | |
typedef std::map< size_t, fc::TransferStats > | TransferStatsMap |
Track all of the individual file transfers, where the key is a numeric sequence describing the order of the file transfer. More... | |
typedef void(* | StatisticsCallback) (const fc::GlobalStateAndStats &stats, void *ptr) |
Allow a single callback to be specified when the statistics are updated. More... | |
typedef std::list< std::string > | StrList |
Defined for convenience: a list of text strings. More... | |
typedef std::vector< std::string > | StrVec |
Defined for convenience: a vector of text strings. More... | |
typedef std::map< std::string, std::string > | StrMap |
Defined for convenience: an ordered map where both the key and the value are text strings. More... | |
typedef std::set< std::string > | StrSet |
Defined for convenience: an ordered set of text strings. More... | |
typedef std::vector< FileDetails > | FDVec |
A std::vector of fc::FileDetails. More... | |
Functions | |
uint64_t | bps (const fc::ECommonBandwidth &bandwidth) |
Convert the common bandwidth enum value to a usable bps value. More... | |
std::string | formatTransferStatsEState (const fc::TransferStats::EState state) |
Format the MD5 and transfer state enums into text strings. More... | |
time_t | to_time_t (const std::chrono::high_resolution_clock::time_point &tp) |
Convenience function to convert time_point objects to traditional time_t values (seconds since 1970-01-01 00:00:00 UTC). More... | |
std::string | formatTimeRecent (const std::chrono::high_resolution_clock::time_point &tp) |
Format the time in an easy-to-read text string. More... | |
std::string | formatTimeRecent (const time_t tt) |
Format the absolute time in an easy-to-read text string. More... | |
std::string | formatTimeDuration (const std::chrono::high_resolution_clock::duration &d) |
Format the "time remaining" statistic as a number followed by a common 1-letter description. More... | |
std::string | formatTimeDuration (const time_t tt) |
Format the relative "time remaining" statistic as a number followed by a common 1-letter description. More... | |
std::string | formatTimeDuration2 (const std::chrono::high_resolution_clock::duration &d) |
Format the "time remaining" statistic as a common time string, such as HH:MM:SS . More... | |
std::string | formatTimeDuration2 (const time_t tt) |
Format the relative "time remaining" statistic as a common time string, such as HH:MM:SS . More... | |
std::string | formatTimestamp (std::chrono::high_resolution_clock::time_point tp) |
Format the absolute time point using "YYYY:MM:DD HH:MM:SS" . More... | |
std::string | formatTimestamp2 (std::chrono::high_resolution_clock::time_point tp) |
Format the absolute time point using "YYYY:MM:DD HH:MM:SS.mmmmmm" where mmmmmm is microseconds. More... | |
std::string | formatTransferRate (const uint64_t bps) |
Format the transfer rate statistic using the common descriptions Kbps, Mbps, etc. More... | |
std::string | formatTransferRate (const fc::ECommonBandwidth &bandwidth) |
Similar to the other fc::formatTransferRate(), but takes a bandwidth enum so the enumerator doesn't get converted to a numeric value. More... | |
std::string | formatBytesSI (const uint64_t bytes) |
Format the payload bytes using SI units (1000 bytes per "K"). More... | |
std::string | formatBytesIEC (const uint64_t bytes) |
Format the payload bytes using IEC units (1024 bytes per "K"). More... | |
std::string | formatBytesOldStyle (const uint64_t bytes) |
Format the payload bytes using IEC units (1024 bytes per "K"), similar to IEC but leave out the middle "i". More... | |
const StrMap & | emptyMap () |
Function that always returns an empty map. Used internally by FC++. More... | |
std::string | baseVersionStr () |
Return a simple version string. More... | |
std::string | libfcVersionStr () |
Return the version string of the FC++ library. More... | |
int | libfcBitSize () |
Determine if the library was built for a 32-bit or 64-bit platform. More... | |
std::string | opensslVersionStr () |
Determine the version of OpenSSL used by FC++. More... | |
fc::FtpServerReplyCodes | getCodeFromServerReply (const std::string &reply) |
Parse the given string and return the 3-digit FTP status code. More... | |
std::string | getTextFromServerReply (const std::string &reply) |
Parse the given string and return only the last line of text following the 3-digit FTP status code. More... | |
All of the FileCatalyst classes and objects are declared within the fc namespace.
typedef std::map<size_t, fc::TransferStats> fc::TransferStatsMap |
Track all of the individual file transfers, where the key is a numeric sequence describing the order of the file transfer.
typedef void(* fc::StatisticsCallback) (const fc::GlobalStateAndStats &stats, void *ptr) |
Allow a single callback to be specified when the statistics are updated.
During active file transfers, most of the file statistics and global statistics are updated exactly once per second. A callback can be defined which will be called every second immediately after these statistics have been updated.
This will normally be used as follows:
typedef std::list<std::string> fc::StrList |
Defined for convenience: a list of text strings.
typedef std::vector<std::string> fc::StrVec |
Defined for convenience: a vector of text strings.
typedef std::map<std::string, std::string> fc::StrMap |
Defined for convenience: an ordered map where both the key and the value are text strings.
typedef std::set<std::string> fc::StrSet |
Defined for convenience: an ordered set of text strings.
typedef std::vector<FileDetails> fc::FDVec |
A std::vector of fc::FileDetails.
enum fc::EClientIdMajor |
Enumerator | |
---|---|
kInvalidMajorId | |
kCli | 3 FC CLI tool |
kApi | 7 FC API (e.g., C++ API) |
kMobile | 15 FC Mobile (e.g., iOS app) |
enum fc::EClientIdMinor |
Enumerator | |
---|---|
kInvalidMinorId | |
kCliJava | 7 Java application |
kCliCpp | 8 C++ CLI tool |
kApiCpp | 10 C++ API |
kMobileUploaderIos | 13 iPhone/iOS tool |
kApiIos | 14 C++ API on iPhone/iOS |
enum fc::ETransferMode |
Enumerator | |
---|---|
kInvalidTransferMode | |
kFtp | 1 TCP/FTP (original FTP mode) |
kTcp | 1 TCP/FTP (original FTP mode) |
kUdp | 2 UDP (FileCatalyst mode) |
enum fc::EConnectionMode |
Enumerator | |
---|---|
kInvalidConnectionMode | |
kActive | server connects to client for transfer (not supported in FC++) |
kPassive | client asks server for a port to which it connects to transfer files |
enum fc::ECommonBandwidth |
Enumerations for several common bandwidth values.
Instead, you'll want to pass the enum directly, or use a 64-bit unsigned integer for bps values:
Enumerator | |
---|---|
kInvalidBandwidth | same as kZero_bps |
kZero_bps | 0 bps |
k1_Kbps | 1000 bps |
k1200_bps | 1200 bps |
k2400_bps | 2400 bps |
k4800_bps | 4800 bps |
k9600_bps | 9600 bps |
k14_4_Kbps | 14400 bps |
k28_8_Kbps | 28800 bps |
k33_6_Kbps | 36600 bps |
k56_Kbps | 56000 bps |
k64_Kbps | 64000 bps |
k128_Kbps | 128000 bps |
k144_Kbps | 144000 bps |
k236_8_Kbps | 236800 bps |
k256_Kbps | 256000 bps |
k384_Kbps | 384000 bps |
k640_Kbps | 640000 bps |
k768_Kbps | 768000 bps |
k1_Mbps | 1000000 bps |
k1_544_Mbps | 1544000 bps |
k2_Mbps | 2000000 bps |
k2_048_Mbps | 2048000 bps |
k2_5_Mbps | 2500000 bps |
k3_152_Mbps | 3152000 bps |
k3_5_Mbps | 3500000 bps |
k4_Mbps | 4000000 bps |
k6_312_Mbps | 6312000 bps |
k8_448_Mbps | 8448000 bps |
k10_Mbps | 10000000 bps |
k11_Mbps | 11000000 bps |
k16_Mbps | 16000000 bps |
k32_064_Mbps | 32064000 bps |
k34_368_Mbps | 34368000 bps |
k44_736_Mbps | 44736000 bps |
k51_84_Mbps | 51840000 bps |
k54_Mbps | 54000000 bps |
k89_472 | 89472000 bps |
k97_728_Mbps | 97728000 bps |
k100_Mbps | 100000000 bps |
k135_Mbps | 135000000 bps |
k139_264_Mbps | 139264000 bps |
k155_52_Mbps | 155520000 bps |
k274_176_Mbps | 274176000 bps |
k397_200_Mbps | 397200000 bps |
k400_352_Mbps | 400352000 bps |
k466_56_Mbps | 466560000 bps |
k565_148_Mbps | 565148000 bps |
k600_Mbps | 600000000 bps |
k622_08_Mbps | 622080000 bps |
k933_12_Mbps | 933120000 bps |
k1_Gbps | 1000000000 bps |
k1244_16_Mbps | 1244160000 bps |
k1_3_Gbps | 1300000000 bps |
k1866_24_Mbps | 1866240000 bps |
k2488_32_Mbps | 2488320000 bps (this value requires an unsigned 32-bit interger) |
k4976_64_Mbps | 4967640000 bps (this value requires a 64-bit integer) |
k6_75_Gbps | 6750000000 bps (this value requires a 64-bit integer) |
k9953_28_Mbps | 9953280000 bps (this value requires a 64-bit integer) |
k10_Gbps | 10000000000 bps (this value requires a 64-bit integer) |
k13_1_Gbps | 13178880000 bps (this value requires a 64-bit integer) |
k39_813_Gbps | 39813120000 bps (this value requires a 64-bit integer) |
k1200Modem | 1200 bps |
k2400Modem | 2400 bps |
k9600Modem | 9600 bps |
k14KModem | 14.4 Kbps |
k28KModem | 28.8 Kbps |
k33KModem | 33.6 Kbps |
k56KModem | 56 Kbps |
k64KISDN | ISDN, 64K. |
k128KISDN | ISDN, 128K. |
k144IDSL | IDSL, 144 Kbps. |
kDS0 | DS-0, 64 Kbps. |
kDS1 | DS-1, 1.54 Mbps. |
kDS2 | DS-2, 6.312 Mbps. |
kDS3 | DS-3, 44.74 Mbps. |
kDS4 | DS-4, 274.176 Mbps. |
kT1 | T1, 1.54 Mbps. |
kE1 | E1, 2.048 Mbps. |
kT2 | T2, 6.31 Mbps. |
kT3 | T3, 44.74 Mbps. |
kT4 | T4, 274.18 Mbps. |
kT5 | T5, 400.35 Mbps. |
kOC1 | OC-1, 51.84 Mbps. |
kOC3 | OC-3, 155.52 Mbps. |
kOC9 | OC-9, 466.56 Mbps. |
kOC12 | OC-12, 0.62 Gbps. |
kOC18 | OC-18, 0.93 Gbps. |
kOC24 | OC-24, 1.24 Gbps. |
kOC36 | OC-36, 1.87 Gbps. |
kOC48 | OC-48, 2,49 Gbps. |
kOC96 | OC-96, 4.98 Gbps. |
kOC192 | OC-192, 9.95 Gbps. |
kOC256 | OC-256, 13.1 Gbps. |
kOC768 | OC-768, 39.8 Gbps. |
k10BaseX | 10 Mbps |
k100BaseX | 100 Mbps |
k1000BaseX | 1 Gbps |
k10GBaseX | 10 Gbps |
kEthernet | 10 Mbps |
kFastEthernet | 100 Mbps |
kGigabit | 1 Gbps |
k10Gigabit | 10 Gbps |
k80211 | 802.11, 2 Mbps |
k80211a | 802.11a, 54 Mbps |
k80211b | 802.11b, 11 Mbps |
k80211g | 802.11g, 54 Mbps |
k80211n | 802.11n, 600 Mbps |
k80211ac | 802.11ac, 1.3 Gbps |
k80211ad | 802.11ad, 6.75 Gbps |
k1G | 1G, 1200 bps |
k2G | 2G GSM, 14.4 Kbps |
k2_5G | 2.5G, GPRS, 56 Kbps |
k2_75G | 2.75G, EDGE, 236.8 Kbps |
k3G | 3G, UMTS, 384 Kbps |
k4G | 4G, 100 Mbps |
An enum to represent possible FTP server reply code.
Enumerator | |
---|---|
k110RestartMarkerReply | |
k120ServiceReadyInMinutes | |
k125DataConnectionAlreadyOpen | |
k150FileStatusOkayOpenDataConnection | |
k200CommandOkay | |
k202CommandNotImplemented | also see k502CommandNotImplemented |
k211SystemStatus | |
k212DirectoryStatus | |
k213FileStatus | |
k214HelpMessage | |
k215OperatingSystem | |
k220ReadyForNewUser | |
k221ClosingConnectionLoggedOut | |
k225DataConnectionOpen | |
k226ClosingDataConnectionTransferDone | |
k227ServerOpenedPassiveConnection | (h1,h2,h3,h4,p1,p2) |
k228ServerEnteringLongPassiveMode | (long address, port) |
k229ServerEnteringExtendedPassiveMode | (|||port|) |
k230UserLoggedIn | |
k231UserLoggedOut | |
k232WillLogoutWhenTransferCompletes | |
k234SecurityDataExchangeComplete | |
k250RequestedActionOkay | |
k252Echo | |
k255InTargetDirectoryAlready | |
k257PathCreatedOrDirectoryStatus | |
k331SendPassword | |
k332NeedAccountForLogin | |
k350RequestedActionPendingFurtherInfo | |
k421ServiceNotAvailableClosingControl | |
k425CannotOpenDataConnection | |
k426DataConnectionClosedAbnormally | |
k430InvalidUsernameOrPassword | |
k431TemporarilyUnableToProcessSecurity | |
k434RequestedHostUnavailable | |
k450ActionNotTakenBusyOrUnavailable | |
k451ActionAbortedLocalError | |
k452ActionNotTakenOutOfDiskSpace | |
k500CommandNotRecognized | |
k501ErrorInParametersOrArguments | |
k502CommandNotImplemented | also see k202CommandNotImplemented |
k503BadSequenceOfCommands | |
k504CommandNotImplementedWithParm | |
k521DataConnectionCannotBeOpened | |
k530NotLoggedIn | |
k532NeedAccount | |
k533CommandProtectionLevelDenied | |
k534RequestDeniedDueToPolicy | |
k550RequestAbortedFileOrDirectoryError | |
k551RequestAbortedPageTypeUnknown | |
k552RequestAbortedOutOfDiskSpace | |
k553RequestAbortedIllegalFilename | |
kInvalid | |
k1xxMore | any 1xx-style response |
k2xxOkay | any 2xx-style positive response |
k3xxPending | any 3xx-style response |
kAny | any response that matches >= 100 and < 600 |
kOkay | any response that matches 1xx, 2xx, or 3xx |
kNotOkay | any response that matches < 100 or >= 400 |
kDataConnectionReady | matches both k125DataConnectionAlreadyOpen and k150FileStatusOkayOpenDataConnection |
kNone | do not expect a response
|
uint64_t fc::bps | ( | const fc::ECommonBandwidth & | bandwidth | ) |
Convert the common bandwidth enum value to a usable bps value.
int
, or a 32-bit uint
. You must use uint64_t
to store bps.References k100_Mbps, k10_Gbps, k10_Mbps, k11_Mbps, k1200_bps, k1244_16_Mbps, k128_Kbps, k135_Mbps, k139_264_Mbps, k13_1_Gbps, k144_Kbps, k14_4_Kbps, k155_52_Mbps, k16_Mbps, k1866_24_Mbps, k1_3_Gbps, k1_544_Mbps, k1_Gbps, k1_Kbps, k1_Mbps, k236_8_Kbps, k2400_bps, k2488_32_Mbps, k256_Kbps, k274_176_Mbps, k28_8_Kbps, k2_048_Mbps, k2_5_Mbps, k2_Mbps, k32_064_Mbps, k33_6_Kbps, k34_368_Mbps, k384_Kbps, k397_200_Mbps, k39_813_Gbps, k3_152_Mbps, k3_5_Mbps, k400_352_Mbps, k44_736_Mbps, k466_56_Mbps, k4800_bps, k4976_64_Mbps, k4_Mbps, k51_84_Mbps, k54_Mbps, k565_148_Mbps, k56_Kbps, k600_Mbps, k622_08_Mbps, k640_Kbps, k64_Kbps, k6_312_Mbps, k6_75_Gbps, k768_Kbps, k89_472, k8_448_Mbps, k933_12_Mbps, k9600_bps, k97_728_Mbps, k9953_28_Mbps, and kZero_bps.
|
inline |
Convert easy-to-use numerical values to bps values.
For example, these bandwidth lines all produce the same results. Choose the style you prefer:
|
inline |
Convert easy-to-use numerical values to bps values.
For example, these bandwidth lines all produce the same results. Choose the style you prefer:
|
inline |
Convert easy-to-use numerical values to bps values.
For example, these bandwidth lines all produce the same results. Choose the style you prefer:
References bps(), and k1_Kbps.
|
inline |
Convert easy-to-use numerical values to bps values.
For example, these bandwidth lines all produce the same results. Choose the style you prefer:
References bps(), and k1_Kbps.
|
inline |
Convert easy-to-use numerical values to bps values.
For example, these bandwidth lines all produce the same results. Choose the style you prefer:
References bps(), and k1_Mbps.
|
inline |
Convert easy-to-use numerical values to bps values.
For example, these bandwidth lines all produce the same results. Choose the style you prefer:
References bps(), and k1_Mbps.
|
inline |
Convert easy-to-use numerical values to bps values.
For example, these bandwidth lines all produce the same results. Choose the style you prefer:
References bps(), and k1_Gbps.
|
inline |
Convert easy-to-use numerical values to bps values.
For example, these bandwidth lines all produce the same results. Choose the style you prefer:
References bps(), and k1_Gbps.
std::string fc::formatTransferStatsEState | ( | const fc::TransferStats::EState | state | ) |
Format the MD5 and transfer state enums into text strings.
References fc::TransferStats::kFull, fc::TransferStats::kInvalid, fc::TransferStats::kMd5Failed, fc::TransferStats::kMd5InProgress, fc::TransferStats::kMd5Skipped, fc::TransferStats::kMd5Success, fc::TransferStats::kPartial, fc::TransferStats::kPending, fc::TransferStats::kSkippedFileExists, fc::TransferStats::kSkippedMD5, fc::TransferStats::kTransferFailed, fc::TransferStats::kTransferFinished, fc::TransferStats::kTransferStarted, and fc::TransferStats::kUnknown.
time_t fc::to_time_t | ( | const std::chrono::high_resolution_clock::time_point & | tp | ) |
Convenience function to convert time_point objects to traditional time_t
values (seconds since 1970-01-01 00:00:00 UTC).
std::string fc::formatTimeRecent | ( | const std::chrono::high_resolution_clock::time_point & | tp | ) |
Format the time in an easy-to-read text string.
The specified time can be in the past or in the future. The further from now, the more precision will be sacrificed for ease of readability.
For example, the text returned could be:
"in 3 hours"
"10 minutes ago"
"in 45 seconds"
References to_time_t().
std::string fc::formatTimeRecent | ( | const time_t | tt | ) |
Format the absolute time in an easy-to-read text string.
The specified time can be in the past or in the future. The further from now, the more precision will be sacrificed for ease of readability.
For example, the text returned could be:
"in 3 hours"
"10 minutes ago"
"in 45 seconds"
[in] | tt | The time "tt" is absolute (not relative) meaning it must contain the number of seconds since 1970-01-01 0:00:00. |
std::string fc::formatTimeDuration | ( | const std::chrono::high_resolution_clock::duration & | d | ) |
Format the "time remaining" statistic as a number followed by a common 1-letter description.
For example, the text returned could be:
10s
45m
3h
std::string fc::formatTimeDuration | ( | const time_t | tt | ) |
Format the relative "time remaining" statistic as a number followed by a common 1-letter description.
For example, the text returned could be:
10s
45m
3h
[in] | tt | The time "tt" is relative (not absolute) meaning it is relative to now, not since epoch (1970-01-01 0:00:00). |
std::string fc::formatTimeDuration2 | ( | const std::chrono::high_resolution_clock::duration & | d | ) |
Format the "time remaining" statistic as a common time string, such as HH:MM:SS
.
If HH
is zero, then only MM:SS
will be returned.
For example, the text returned could be:
0:10
3:00:18
std::string fc::formatTimeDuration2 | ( | const time_t | tt | ) |
Format the relative "time remaining" statistic as a common time string, such as HH:MM:SS
.
If HH
is zero, then only MM:SS
will be returned.
For example, the text returned could be:
0:10
3:00:18
[in] | tt | The time "tt" is relative (not absolute) meaning it is relative to now , not since epoch (1970-01-01 0:00:00). |
std::string fc::formatTimestamp | ( | std::chrono::high_resolution_clock::time_point | tp | ) |
Format the absolute time point using "YYYY:MM:DD HH:MM:SS"
.
For example, the text returned could be:
2014-09-17 08:53:16
References to_time_t().
std::string fc::formatTimestamp2 | ( | std::chrono::high_resolution_clock::time_point | tp | ) |
Format the absolute time point using "YYYY:MM:DD HH:MM:SS.mmmmmm"
where mmmmmm is microseconds.
Reminder:
So a valid microsecond value ranges from 0 to 999,999.
For example, the text returned could be:
2014-09-17 08:53:16.073211
References formatTimestamp().
std::string fc::formatTransferRate | ( | const uint64_t | bps | ) |
Format the transfer rate statistic using the common descriptions Kbps, Mbps, etc.
For example:
Input Value | Output String |
---|---|
125800 | "125.80 Kbps" |
9576328 | "9.58 Mbps" |
References bps(), and convertNumberToSiOrIecString().
std::string fc::formatTransferRate | ( | const fc::ECommonBandwidth & | bandwidth | ) |
Similar to the other fc::formatTransferRate(), but takes a bandwidth enum so the enumerator doesn't get converted to a numeric value.
References bps(), and formatTransferRate().
std::string fc::formatBytesSI | ( | const uint64_t | bytes | ) |
Format the payload bytes using SI units (1000 bytes per "K").
For example:
Input Value | Output String |
---|---|
2000 bytes | "2.00 KB" |
2048 bytes | "2.05 KB" |
References:
Decimal SI prefixes:
Units | Power |
---|---|
KB | 1000^1 |
MB | 1000^2 |
GB | 1000^3 |
TB | 1000^4 |
PB | ...etc... |
Different formatting options for bytes:
FC++ API | Base | Example Input | Example Output | Reference |
---|---|---|---|---|
fc::formatBytesSI() | 1000 | 1048576 | "1.05 MB" | http://en.wikipedia.org/wiki/Metric_prefix |
fc::formatBytesIEC() | 1024 | 1048576 | "1.00 MiB" | http://en.wikipedia.org/wiki/Binary_prefix |
fc::formatBytesOldStyle() | 1024 | 1048576 | "1.00 MB" | http://en.wikipedia.org/wiki/Binary_prefix#Inconsistent_use_of_units |
References convertNumberToSiOrIecString().
std::string fc::formatBytesIEC | ( | const uint64_t | bytes | ) |
Format the payload bytes using IEC units (1024 bytes per "K").
For example:
Input Value | Output String |
---|---|
2000 bytes | "1.95 KiB" |
2048 bytes | "2.00 KiB" |
References:
Binary IEC prefixes:
Units | Power |
---|---|
KiB | 1024^1 |
MiB | 1024^2 |
GiB | 1024^3 |
TiB | 1024^4 |
PiB | ...etc... |
Different formatting options for bytes:
FC++ API | Base | Example Input | Example Output | Reference |
---|---|---|---|---|
fc::formatBytesSI() | 1000 | 1048576 | "1.05 MB" | http://en.wikipedia.org/wiki/Metric_prefix |
fc::formatBytesIEC() | 1024 | 1048576 | "1.00 MiB" | http://en.wikipedia.org/wiki/Binary_prefix |
fc::formatBytesOldStyle() | 1024 | 1048576 | "1.00 MB" | http://en.wikipedia.org/wiki/Binary_prefix#Inconsistent_use_of_units |
References convertNumberToSiOrIecString().
std::string fc::formatBytesOldStyle | ( | const uint64_t | bytes | ) |
Format the payload bytes using IEC units (1024 bytes per "K"), similar to IEC but leave out the middle "i".
For example:
Input Value | Output String |
---|---|
2000 bytes | "1.95 KB" |
2048 bytes | "2.00 KB" |
Different formatting options for bytes:
FC++ API | Base | Example Input | Example Output | Reference |
---|---|---|---|---|
fc::formatBytesSI() | 1000 | 1048576 | "1.05 MB" | http://en.wikipedia.org/wiki/Metric_prefix |
fc::formatBytesIEC() | 1024 | 1048576 | "1.00 MiB" | http://en.wikipedia.org/wiki/Binary_prefix |
fc::formatBytesOldStyle() | 1024 | 1048576 | "1.00 MB" | http://en.wikipedia.org/wiki/Binary_prefix#Inconsistent_use_of_units |
References convertNumberToSiOrIecString().
const fc::StrMap & fc::emptyMap | ( | ) |
Function that always returns an empty map. Used internally by FC++.
std::string fc::baseVersionStr | ( | ) |
Return a simple version string.
This is the base version of the FileCatalyst software, not the FC++ library version. This should be similar to:
References BASEFCVER.
std::string fc::libfcVersionStr | ( | ) |
Return the version string of the FC++ library.
This is not related to the base FileCatalyst software version. Instead, this describes the C++ library build version. For example, this could be:
References LIBFCVER.
int fc::libfcBitSize | ( | ) |
Determine if the library was built for a 32-bit or 64-bit platform.
References LIBFCBITSIZE.
std::string fc::opensslVersionStr | ( | ) |
Determine the version of OpenSSL used by FC++.
For example, this could return "OpenSSL 1.1.1d 10 Sep 2019"
.
fc::FtpServerReplyCodes fc::getCodeFromServerReply | ( | const std::string & | reply | ) |
Parse the given string and return the 3-digit FTP status code.
Supports single-line and multi-line replies.
References kInvalid.
std::string fc::getTextFromServerReply | ( | const std::string & | reply | ) |
Parse the given string and return only the last line of text following the 3-digit FTP status code.
Supports single-line and multi-line replies.