1 #ifndef __DIGIDOC_CONVERT_H__
2 #define __DIGIDOC_CONVERT_H__
25 #include <libdigidoc/DigiDocLib.h>
26 #include <libdigidoc/DigiDocDefs.h>
46 void b2h(
byte b,
char* dest);
55 EXP_OPTION
void convFNameToWin(
const char* src,
char* dest,
int len);
64 EXP_OPTION
void convWinToFName(
const char* src,
char* dest,
int len);
67 EXP_OPTION
void hex2bin(
const char* hex,
byte* bin,
int* len);
70 EXP_OPTION
void bin2hex(
const byte* bin,
int blen,
char* hex,
int* len);
80 EXP_OPTION
char* ascii2utf8(
const char* ascii,
char* utf8out,
int* outlen);
83 EXP_OPTION
char* utf82ascii(
const char* utf8in,
char* asciiout,
int* outlen);
86 EXP_OPTION
void unicode2ascii(
const char* uni,
char* dest);
88 EXP_OPTION
void unicodeEscapes2utf8(
const char* uni,
char* dest);
91 char* escape2xmlsym(
const char* src);
94 int hasUmlauts(
const char* str);
95 int str2asn1time(
const SignedDoc* pSigDoc,
const char* str, ASN1_GENERALIZEDTIME* asn1tm);
102 char* escape2xmlsym(
const char* src);
104 char* unescapeXmlsym(
const char* src);
111 EXP_OPTION
int ddocConvertInput(
const char* src,
char** dest);
114 EXP_OPTION
void encode(
const byte* raw,
int rawlen,
byte* buf,
int* buflen);
116 EXP_OPTION
void decode(
const byte* raw,
int rawlen,
byte* buf,
int* buflen);
132 EXP_OPTION
int ddocDecodeBase64Data(
void* data,
long lLen,
DigiDocMemBuf* pMBufDest);
154 int decodeGeneralizedTime(ASN1_GENERALIZEDTIME *tm,
155 int* y,
int* M,
int* d,
156 int* h,
int* m,
int* s);
169 int decodeUTCTime(ASN1_UTCTIME *tm,
170 int* y,
int* M,
int* d,
171 int* h,
int* m,
int* s);
176 int asn1time2time_t(ASN1_TIME* tm, time_t* pT);
178 int asn1time2time_t_local(ASN1_TIME* tm, time_t* pT);
183 int asn1time2strYear(
const SignedDoc* pSigDoc, ASN1_TIME* tm,
char* buf,
int year,
int len);
188 int asn1time2str(
const SignedDoc* pSigDoc, ASN1_TIME* tm,
char* buf,
int len);
197 EXP_OPTION
int time_t2str(time_t t,
char* szTimestamp,
int len);
205 EXP_OPTION
int str2time_t(
char* szTimestamp, time_t* pT);
214 EXP_OPTION
int ddocConvertFileName(
char* dest,
int destlen,
const char* src);
227 EXP_OPTION
int oem2unicode(
const char* oem,
char** unicode,
int* outlen);
236 EXP_OPTION
int unicode2utf8(
const char* unicode,
char** utf8,
int* outlen);
245 EXP_OPTION
int oem2utf8(
const char* oem,
char* utf8,
int len);
254 EXP_OPTION
int utf82unicode(
const char* utf8,
char** unicode,
int* outlen);
263 EXP_OPTION
int unicode2oem(
const char* unicode,
char** oem,
int* outlen);
272 EXP_OPTION
int utf82oem(
const char* utf8,
char* oem,
int len);
282 EXP_OPTION
int getDataFileFileName(
SignedDoc* pSigDoc,
DataFile* pDf,
char* outFileName,
int len);
292 EXP_OPTION
void freeLibMem(
void* p);
300 #endif // __DIGIDOC_CONVERT_H__