"Fossies" - the Fresh Open Source Software Archive

Member "unrar/unicode.hpp" (4 May 2022, 1374 Bytes) of package /linux/misc/unrarsrc-6.1.7.tar.gz:


As a special service "Fossies" has tried to format the requested source page into HTML format using (guessed) C and C++ source code syntax highlighting (style: standard) with prefixed line numbers and code folding option. Alternatively you can here view or download the uninterpreted source code file. For more information about "unicode.hpp" see the Fossies "Dox" file reference documentation.

    1 #ifndef _RAR_UNICODE_
    2 #define _RAR_UNICODE_
    3 
    4 #if defined( _WIN_ALL)
    5 #define DBCS_SUPPORTED
    6 #endif
    7 
    8 bool WideToChar(const wchar *Src,char *Dest,size_t DestSize);
    9 bool CharToWide(const char *Src,wchar *Dest,size_t DestSize);
   10 byte* WideToRaw(const wchar *Src,byte *Dest,size_t SrcSize);
   11 wchar* RawToWide(const byte *Src,wchar *Dest,size_t DestSize);
   12 void WideToUtf(const wchar *Src,char *Dest,size_t DestSize);
   13 size_t WideToUtfSize(const wchar *Src);
   14 bool UtfToWide(const char *Src,wchar *Dest,size_t DestSize);
   15 bool IsTextUtf8(const byte *Src);
   16 bool IsTextUtf8(const byte *Src,size_t SrcSize);
   17 
   18 int wcsicomp(const wchar *s1,const wchar *s2);
   19 int wcsnicomp(const wchar *s1,const wchar *s2,size_t n);
   20 const wchar_t* wcscasestr(const wchar_t *str, const wchar_t *search);
   21 #ifndef SFX_MODULE
   22 wchar* wcslower(wchar *s);
   23 wchar* wcsupper(wchar *s);
   24 #endif
   25 int toupperw(int ch);
   26 int tolowerw(int ch);
   27 int atoiw(const wchar *s);
   28 int64 atoilw(const wchar *s);
   29 
   30 #ifdef DBCS_SUPPORTED
   31 class SupportDBCS
   32 {
   33   public:
   34     SupportDBCS();
   35     void Init();
   36     char* charnext(const char *s);
   37 
   38     bool IsLeadByte[256];
   39     bool DBCSMode;
   40 };
   41 extern SupportDBCS gdbcs;
   42 
   43 inline char* charnext(const char *s) {return (char *)(gdbcs.DBCSMode ? gdbcs.charnext(s):s+1);}
   44 inline bool IsDBCSMode() {return gdbcs.DBCSMode;}
   45 
   46 #else
   47 #define charnext(s) ((s)+1)
   48 #define IsDBCSMode() (false)
   49 #endif
   50 
   51 
   52 #endif