Static Public Member Functions | |
static bool | canConvert (const char *input, ConversionCodepage::Codepage codepage) |
Returns true if conversion is possible. | |
static bool | canConvert (const std::string &input, ConversionCodepage::Codepage codepage) |
static std::string | doConvert (const char *input, ConversionCodepage::Codepage codepage) |
Does not convert AT ALL. | |
static const std::string & | doConvert (const std::string &input, ConversionCodepage::Codepage codepage) |
Does not convert AT ALL. |
This probably looks stupid at first sight, but if you wish to TRULY make UNICODE/ASCII support be COMPLETELY transparent you should in fact have a version that does NOTHING.
The reason is to avoid having the application do custom "#ifdef" on UNICODE checks to see "if we're supposed to convert or not".
static bool canConvert | ( | const char * | input, | |
ConversionCodepage::Codepage | codepage | |||
) | [static] |
Returns true if conversion is possible.
There may axist many reasons as to why conversion is NOT possible. E.g. we may have a string which contains a character which has not been fully seen! You might have had some stream operation which haven't extracted a string containing the whole character, meaning you may have seen a leading byte for an UTF-8 conversion but no trailing byte etc.
static bool canConvert | ( | const std::string & | input, | |
ConversionCodepage::Codepage | codepage | |||
) | [static] |
There may axist many reasons as to why conversion is NOT possible. E.g. we may have a string which contains a character which has not been fully seen! You might have had some stream operation which haven't extracted a string containing the whole character, meaning you may have seen a leading byte for an UTF-8 conversion but no trailing byte etc.
static std::string doConvert | ( | const char * | input, | |
ConversionCodepage::Codepage | codepage | |||
) | [static] |
Does not convert AT ALL.
Read the class info to understand why this is here.
static const std::string& doConvert | ( | const std::string & | input, | |
ConversionCodepage::Codepage | codepage | |||
) | [static] |
Does not convert AT ALL.
Read the class info to understand why this is here.
Note the signature is slightly different than the "converting" classes. This is to avoid unnecesary copying of the input string.