diff options
Diffstat (limited to 'protocols/WhatsApp/src/WhatsAPI++/utilities.h')
-rw-r--r-- | protocols/WhatsApp/src/WhatsAPI++/utilities.h | 70 |
1 files changed, 37 insertions, 33 deletions
diff --git a/protocols/WhatsApp/src/WhatsAPI++/utilities.h b/protocols/WhatsApp/src/WhatsAPI++/utilities.h index 1c071471bd..fec1b29862 100644 --- a/protocols/WhatsApp/src/WhatsAPI++/utilities.h +++ b/protocols/WhatsApp/src/WhatsAPI++/utilities.h @@ -43,40 +43,44 @@ #define _LOGDATA(format, ...) if (_DEBUGENABLED) Utilities::logData(format, ##__VA_ARGS__)
using namespace std;
+
+// these functions must be declared somewhere in the same linking module
+std::string base64_encode(void*, size_t);
+void md5_string(const std::string& data, unsigned char digest[16]);
+
namespace Utilities{
- extern void configureLogging(const char* ident);
- extern void closeLog();
- extern string getCountryCode();
- extern string getMcc();
- extern string getMnc();
- extern string reverseString(const string& str);
- extern string processIdentity(const std::string& password);
- extern int64_t randLong();
- extern int64_t absLong(int64_t num);
- extern string str(int64_t number, int radix);
- extern std::string itoa(int value, unsigned int base);
- extern std::string intToStr(int i);
- extern std::string doubleToStr(double d);
- extern long long parseLongLong(const std::string& str);
- extern time_t parseBBDate(const string& s);
- extern void logData(const char *msg, ...);
- extern long long getCurrentTimeMillis();
- extern unsigned char* bytesToHex(unsigned char* bytes, int length);
- extern unsigned char forDigit(int b);
- extern string md5String(const string& data);
- extern bool saveStringToFile(const string& data, const string& filePath);
- extern bool saveBytesToFile(const string& data, const string& filePath);
- extern bool saveBytesToFile(const std::vector<unsigned char>& data, const string& filePath);
- extern string removeWaDomainFromJid(const string& jid);
- extern string getNameFromPath(const std::string& path);
- extern vector<unsigned char>* loadFileToBytes(const string& path);
- extern bool fileExists(const std::string& path);
- extern std::vector<unsigned char>* getChallengeData(const std::string& file);
- extern bool saveChallengeData(const std::vector<unsigned char>& data, const std::string& file);
- extern std::string utf8_to_utf16(const std::string& utf8);
- extern std::string string_format(const std::string fmt, ...);
- extern std::string string_format(const std::string fmt, va_list ap);
- extern std::string string_format(const char* fmt, va_list ap);
+ void configureLogging(const char* ident);
+ void closeLog();
+ string getCountryCode();
+ string getMcc();
+ string getMnc();
+ string reverseString(const string& str);
+ string processIdentity(const std::string& password);
+ int64_t randLong();
+ int64_t absLong(int64_t num);
+ string str(int64_t number, int radix);
+ std::string itoa(int value, unsigned int base);
+ std::string intToStr(int i);
+ std::string doubleToStr(double d);
+ long long parseLongLong(const std::string& str);
+ time_t parseBBDate(const string& s);
+ void logData(const char *msg, ...);
+ long long getCurrentTimeMillis();
+ std::string bytesToHex(unsigned char* bytes, int length);
+ unsigned char forDigit(int b);
+ bool saveStringToFile(const string& data, const string& filePath);
+ bool saveBytesToFile(const string& data, const string& filePath);
+ bool saveBytesToFile(const std::vector<unsigned char>& data, const string& filePath);
+ string removeWaDomainFromJid(const string& jid);
+ string getNameFromPath(const std::string& path);
+ vector<unsigned char>* loadFileToBytes(const string& path);
+ bool fileExists(const std::string& path);
+ std::vector<unsigned char>* getChallengeData(const std::string& file);
+ bool saveChallengeData(const std::vector<unsigned char>& data, const std::string& file);
+ std::string utf8_to_utf16(const std::string& utf8);
+ std::string string_format(const std::string fmt, ...);
+ std::string string_format(const std::string fmt, va_list ap);
+ std::string string_format(const char* fmt, va_list ap);
}
#endif
|