Open-Transactions
0.93.0-ge03d287
|
#include <OTASCIIArmor.hpp>
Public Member Functions | |
EXPORT | OTASCIIArmor () |
EXPORT | OTASCIIArmor (const char *szValue) |
EXPORT | OTASCIIArmor (const OTData &theValue) |
EXPORT | OTASCIIArmor (const OTPayload &theValue) |
EXPORT | OTASCIIArmor (const OTString &strValue) |
EXPORT | OTASCIIArmor (const OTASCIIArmor &strValue) |
EXPORT | OTASCIIArmor (const OTEnvelope &theEnvelope) |
virtual EXPORT | ~OTASCIIArmor () |
EXPORT OTASCIIArmor & | operator= (const char *szValue) |
EXPORT OTASCIIArmor & | operator= (const OTData &theValue) |
EXPORT OTASCIIArmor & | operator= (const OTString &strValue) |
EXPORT OTASCIIArmor & | operator= (const OTASCIIArmor &strValue) |
EXPORT bool | LoadFromFile (const OTString &foldername, const OTString &filename) |
EXPORT bool | LoadFrom_ifstream (std::ifstream &fin) |
EXPORT bool | SaveTo_ofstream (std::ofstream &fout) |
EXPORT bool | LoadFromExactPath (const std::string &filename) |
EXPORT bool | SaveToExactPath (const std::string &filename) |
EXPORT bool | LoadFromString (OTString &theStr, bool bEscaped=false, const std::string str_override="-----BEGIN") |
EXPORT bool | WriteArmoredString (OTString &strOutput, const std::string str_type, bool bEscaped=false) const |
EXPORT bool | WriteArmoredFile (const OTString &foldername, const OTString &filename, const std::string str_type, bool bEscaped=false) const |
EXPORT bool | GetData (OTData &theData, bool bLineBreaks=true) const |
EXPORT bool | GetAndUnpackData (OTData &theData, bool bLineBreaks=true) const |
EXPORT bool | SetData (const OTData &theData, bool bLineBreaks=true) |
EXPORT bool | SetAndPackData (const OTData &theData, bool bLineBreaks=true) |
EXPORT bool | GetString (OTString &theData, bool bLineBreaks=true) const |
EXPORT bool | GetAndUnpackString (OTString &theData, bool bLineBreaks=true) const |
EXPORT bool | SetString (const OTString &theData, bool bLineBreaks=true) |
EXPORT bool | SetAndPackString (const OTString &theData, bool bLineBreaks=true) |
EXPORT bool | GetStringMap (std::map< std::string, std::string > &the_map, bool bLineBreaks=true) const |
EXPORT bool | GetAndUnpackStringMap (std::map< std::string, std::string > &the_map, bool bLineBreaks=true) const |
EXPORT bool | SetStringMap (const std::map< std::string, std::string > &the_map, bool bLineBreaks=true) |
EXPORT bool | SetAndPackStringMap (const std::map< std::string, std::string > &the_map, bool bLineBreaks=true) |
Public Member Functions inherited from opentxs::OTString | |
EXPORT | OTString () |
EXPORT | OTString (const OTString &value) |
EXPORT | OTString (const OTASCIIArmor &value) |
OTString (const OTSignature &value) | |
EXPORT | OTString (const OTContract &value) |
EXPORT | OTString (const OTIdentifier &value) |
OTString (OTPseudonym &value) | |
EXPORT | OTString (const char *value) |
OTString (const char *value, size_t size) | |
EXPORT | OTString (const std::string &value) |
virtual EXPORT | ~OTString () |
virtual EXPORT void | Release () |
void | Initialize () |
EXPORT OTString & | operator= (OTString rhs) |
void | swap (OTString &rhs) |
bool | operator> (const OTString &rhs) const |
bool | operator< (const OTString &rhs) const |
bool | operator<= (const OTString &rhs) const |
bool | operator>= (const OTString &rhs) const |
EXPORT bool | operator== (const OTString &rhs) const |
EXPORT int64_t | ToLong () const |
EXPORT uint64_t | ToUlong () const |
EXPORT bool | At (uint32_t index, char &c) const |
EXPORT bool | Exists () const |
EXPORT bool | DecodeIfArmored (bool escapedIsAllowed=true) |
EXPORT uint32_t | GetLength () const |
EXPORT bool | Compare (const char *compare) const |
EXPORT bool | Compare (const OTString &compare) const |
EXPORT bool | Contains (const char *compare) const |
bool | Contains (const OTString &compare) const |
EXPORT const char * | Get () const |
EXPORT void | Set (const char *data, uint32_t enforcedMaxLength=0) |
EXPORT void | Set (const OTString &data) |
EXPORT bool | MemSet (const char *mem, uint32_t size) |
EXPORT void | Concatenate (const char *arg,...) |
void | Concatenate (const OTString &data) |
void | Truncate (uint32_t index) |
EXPORT void | Format (const char *fmt,...) |
void | ConvertToLowerCase () const |
void | ConvertToUpperCase () const |
EXPORT bool | TokenizeIntoKeyValuePairs (Map &map) const |
EXPORT void | OTfgets (std::istream &ofs) |
bool | sgets (char *buffer, uint32_t size) |
char | sgetc () |
void | sungetc () |
void | reset () |
void | WriteToFile (std::ostream &ofs) const |
void | Release_String () |
EXPORT void | zeroMemory () const |
Static Public Member Functions | |
static OTDB::OTPacker * | GetPacker () |
static EXPORT bool | LoadFromString (OTASCIIArmor &ascArmor, const OTString &strInput, std::string str_bookend="-----BEGIN") |
Static Public Member Functions inherited from opentxs::OTString | |
static bool | vformat (const char *fmt, std::va_list *pvl, std::string &s) |
static EXPORT std::string & | trim (std::string &str) |
static EXPORT std::string | replace_chars (const std::string &str, const std::string &charsFrom, const char &charTo) |
static EXPORT bool | safe_strcpy (char *dest, const char *src, size_t destSize, bool zeroSource=false) |
static size_t | safe_strlen (const char *s, size_t max) |
static EXPORT int64_t | StringToLong (const std::string &number) |
static EXPORT uint64_t | StringToUlong (const std::string &number) |
Additional Inherited Members | |
Public Types inherited from opentxs::OTString | |
typedef std::list< std::string > | List |
typedef std::map< std::string, std::string > | Map |
Protected Attributes inherited from opentxs::OTString | |
uint32_t | length_ |
uint32_t | position_ |
char * | data_ |
Definition at line 170 of file OTASCIIArmor.hpp.
opentxs::OTASCIIArmor::OTASCIIArmor | ( | ) |
Definition at line 220 of file OTASCIIArmor.cpp.
opentxs::OTASCIIArmor::OTASCIIArmor | ( | const char * | szValue | ) |
Definition at line 261 of file OTASCIIArmor.cpp.
opentxs::OTASCIIArmor::OTASCIIArmor | ( | const OTData & | theValue | ) |
Definition at line 240 of file OTASCIIArmor.cpp.
opentxs::OTASCIIArmor::OTASCIIArmor | ( | const OTPayload & | theValue | ) |
Definition at line 233 of file OTASCIIArmor.cpp.
opentxs::OTASCIIArmor::OTASCIIArmor | ( | const OTString & | strValue | ) |
Definition at line 226 of file OTASCIIArmor.cpp.
opentxs::OTASCIIArmor::OTASCIIArmor | ( | const OTASCIIArmor & | strValue | ) |
Definition at line 247 of file OTASCIIArmor.cpp.
opentxs::OTASCIIArmor::OTASCIIArmor | ( | const OTEnvelope & | theEnvelope | ) |
Definition at line 254 of file OTASCIIArmor.cpp.
|
virtual |
Definition at line 1151 of file OTASCIIArmor.cpp.
bool opentxs::OTASCIIArmor::GetAndUnpackData | ( | OTData & | theData, |
bool | bLineBreaks = true |
||
) | const |
Definition at line 633 of file OTASCIIArmor.cpp.
bool opentxs::OTASCIIArmor::GetAndUnpackString | ( | OTString & | strData, |
bool | bLineBreaks = true |
||
) | const |
if we pack, compress, encode on the way in, that means, therefore, we need to decode, uncompress, then unpack on our way out. Right?
This function will base64-DECODE the string contents, then uncompress them using zlib, and then unpack the result using whatever is the default packer (MsgPack, Protobuf, etc).
I originally added compression because message sizes were too big. Now I'm adding packing, to solve any issues of binary compatibility across various platforms.
Definition at line 398 of file OTASCIIArmor.cpp.
bool opentxs::OTASCIIArmor::GetAndUnpackStringMap | ( | std::map< std::string, std::string > & | the_map, |
bool | bLineBreaks = true |
||
) | const |
Definition at line 496 of file OTASCIIArmor.cpp.
bool opentxs::OTASCIIArmor::GetData | ( | OTData & | theData, |
bool | bLineBreaks = true |
||
) | const |
Definition at line 623 of file OTASCIIArmor.cpp.
|
static |
Definition at line 159 of file OTASCIIArmor.cpp.
bool opentxs::OTASCIIArmor::GetString | ( | OTString & | theData, |
bool | bLineBreaks = true |
||
) | const |
Definition at line 484 of file OTASCIIArmor.cpp.
bool opentxs::OTASCIIArmor::GetStringMap | ( | std::map< std::string, std::string > & | the_map, |
bool | bLineBreaks = true |
||
) | const |
Definition at line 490 of file OTASCIIArmor.cpp.
bool opentxs::OTASCIIArmor::LoadFrom_ifstream | ( | std::ifstream & | fin | ) |
Definition at line 894 of file OTASCIIArmor.cpp.
bool opentxs::OTASCIIArmor::LoadFromExactPath | ( | const std::string & | filename | ) |
Definition at line 879 of file OTASCIIArmor.cpp.
Definition at line 854 of file OTASCIIArmor.cpp.
|
static |
Definition at line 189 of file OTASCIIArmor.cpp.
bool opentxs::OTASCIIArmor::LoadFromString | ( | OTString & | theStr, |
bool | bEscaped = false , |
||
const std::string | str_override = "-----BEGIN" |
||
) |
Definition at line 1025 of file OTASCIIArmor.cpp.
OTASCIIArmor & opentxs::OTASCIIArmor::operator= | ( | const char * | szValue | ) |
Definition at line 267 of file OTASCIIArmor.cpp.
OTASCIIArmor & opentxs::OTASCIIArmor::operator= | ( | const OTData & | theValue | ) |
Definition at line 283 of file OTASCIIArmor.cpp.
OTASCIIArmor & opentxs::OTASCIIArmor::operator= | ( | const OTString & | strValue | ) |
Definition at line 274 of file OTASCIIArmor.cpp.
OTASCIIArmor & opentxs::OTASCIIArmor::operator= | ( | const OTASCIIArmor & | strValue | ) |
Definition at line 290 of file OTASCIIArmor.cpp.
bool opentxs::OTASCIIArmor::SaveTo_ofstream | ( | std::ofstream & | fout | ) |
Definition at line 920 of file OTASCIIArmor.cpp.
bool opentxs::OTASCIIArmor::SaveToExactPath | ( | const std::string & | filename | ) |
Definition at line 907 of file OTASCIIArmor.cpp.
bool opentxs::OTASCIIArmor::SetAndPackData | ( | const OTData & | theData, |
bool | bLineBreaks = true |
||
) |
Definition at line 698 of file OTASCIIArmor.cpp.
bool opentxs::OTASCIIArmor::SetAndPackString | ( | const OTString & | strData, |
bool | bLineBreaks = true |
||
) |
This function first Packs the incoming string, using whatever is the default packer. (MsgPack or Protobuf). Then it Compresses the packed binary data using zlib. (ezcompress.) Then it Base64-Encodes the compressed binary and sets it as a string on THIS OBJECT.
I added these pieces 1-by-1 over time. At first the messages were too int64_t, so I started compressing them. Then they were not binary compatible across various platforms, so I added the packing.
Definition at line 772 of file OTASCIIArmor.cpp.
bool opentxs::OTASCIIArmor::SetAndPackStringMap | ( | const std::map< std::string, std::string > & | the_map, |
bool | bLineBreaks = true |
||
) |
Definition at line 557 of file OTASCIIArmor.cpp.
bool opentxs::OTASCIIArmor::SetData | ( | const OTData & | theData, |
bool | bLineBreaks = true |
||
) |
Definition at line 689 of file OTASCIIArmor.cpp.
bool opentxs::OTASCIIArmor::SetString | ( | const OTString & | theData, |
bool | bLineBreaks = true |
||
) |
Definition at line 846 of file OTASCIIArmor.cpp.
bool opentxs::OTASCIIArmor::SetStringMap | ( | const std::map< std::string, std::string > & | the_map, |
bool | bLineBreaks = true |
||
) |
Definition at line 551 of file OTASCIIArmor.cpp.
bool opentxs::OTASCIIArmor::WriteArmoredFile | ( | const OTString & | foldername, |
const OTString & | filename, | ||
const std::string | str_type, | ||
bool | bEscaped = false |
||
) | const |
Definition at line 945 of file OTASCIIArmor.cpp.
bool opentxs::OTASCIIArmor::WriteArmoredString | ( | OTString & | strOutput, |
const std::string | str_type, | ||
bool | bEscaped = false |
||
) | const |
Definition at line 984 of file OTASCIIArmor.cpp.