Tree @debian/1%6.1.7-3 (Download .tar.gz)
- debian
- acknow.txt
- arccmt.cpp
- archive.cpp
- archive.hpp
- arcread.cpp
- array.hpp
- blake2s.cpp
- blake2s.hpp
- blake2s_sse.cpp
- blake2sp.cpp
- cmddata.cpp
- cmddata.hpp
- cmdfilter.cpp
- cmdmix.cpp
- coder.cpp
- coder.hpp
- compress.hpp
- consio.cpp
- consio.hpp
- crc.cpp
- crc.hpp
- crypt.cpp
- crypt.hpp
- crypt1.cpp
- crypt2.cpp
- crypt3.cpp
- crypt5.cpp
- dll.cpp
- dll.def
- dll.hpp
- dll.rc
- dll_nocrypt.def
- encname.cpp
- encname.hpp
- errhnd.cpp
- errhnd.hpp
- extinfo.cpp
- extinfo.hpp
- extract.cpp
- extract.hpp
- filcreat.cpp
- filcreat.hpp
- file.cpp
- file.hpp
- filefn.cpp
- filefn.hpp
- filestr.cpp
- filestr.hpp
- find.cpp
- find.hpp
- getbits.cpp
- getbits.hpp
- global.cpp
- global.hpp
- hardlinks.cpp
- hash.cpp
- hash.hpp
- headers.cpp
- headers.hpp
- headers5.hpp
- isnt.cpp
- isnt.hpp
- license.txt
- list.cpp
- list.hpp
- loclang.hpp
- log.cpp
- log.hpp
- makefile
- match.cpp
- match.hpp
- model.cpp
- model.hpp
- options.cpp
- options.hpp
- os.hpp
- pathfn.cpp
- pathfn.hpp
- qopen.cpp
- qopen.hpp
- rar.cpp
- rar.hpp
- rardefs.hpp
- rarlang.hpp
- raros.hpp
- rarpch.cpp
- rartypes.hpp
- rarvm.cpp
- rarvm.hpp
- rawint.hpp
- rawread.cpp
- rawread.hpp
- rdwrfn.cpp
- rdwrfn.hpp
- readme.txt
- recvol.cpp
- recvol.hpp
- recvol3.cpp
- recvol5.cpp
- resource.cpp
- resource.hpp
- rijndael.cpp
- rijndael.hpp
- rs.cpp
- rs.hpp
- rs16.cpp
- rs16.hpp
- scantree.cpp
- scantree.hpp
- secpassword.cpp
- secpassword.hpp
- sha1.cpp
- sha1.hpp
- sha256.cpp
- sha256.hpp
- smallfn.cpp
- smallfn.hpp
- strfn.cpp
- strfn.hpp
- strlist.cpp
- strlist.hpp
- suballoc.cpp
- suballoc.hpp
- system.cpp
- system.hpp
- threadmisc.cpp
- threadpool.cpp
- threadpool.hpp
- timefn.cpp
- timefn.hpp
- ui.cpp
- ui.hpp
- uicommon.cpp
- uiconsole.cpp
- uisilent.cpp
- ulinks.cpp
- unicode.cpp
- unicode.hpp
- unpack.cpp
- unpack.hpp
- unpack15.cpp
- unpack20.cpp
- unpack30.cpp
- unpack50.cpp
- unpack50frag.cpp
- unpack50mt.cpp
- unpackinline.cpp
- UnRAR.vcxproj
- UnRARDll.vcxproj
- uowners.cpp
- version.hpp
- volume.cpp
- volume.hpp
- win32acl.cpp
- win32lnk.cpp
- win32stm.cpp
strlist.cpp @debian/1%6.1.7-3 — raw · history · blame
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 | #include "rar.hpp" StringList::StringList() { Reset(); } void StringList::Reset() { Rewind(); StringData.Reset(); StringsCount=0; SavePosNumber=0; } void StringList::AddStringA(const char *Str) { Array<wchar> StrW(strlen(Str)); CharToWide(Str,&StrW[0],StrW.Size()); AddString(&StrW[0]); } void StringList::AddString(const wchar *Str) { if (Str==NULL) Str=L""; size_t PrevSize=StringData.Size(); StringData.Add(wcslen(Str)+1); wcscpy(&StringData[PrevSize],Str); StringsCount++; } bool StringList::GetStringA(char *Str,size_t MaxLength) { Array<wchar> StrW(MaxLength); if (!GetString(&StrW[0],StrW.Size())) return false; WideToChar(&StrW[0],Str,MaxLength); return true; } bool StringList::GetString(wchar *Str,size_t MaxLength) { wchar *StrPtr; if (!GetString(&StrPtr)) return false; wcsncpyz(Str,StrPtr,MaxLength); return true; } #ifndef SFX_MODULE bool StringList::GetString(wchar *Str,size_t MaxLength,int StringNum) { SavePosition(); Rewind(); bool RetCode=true; while (StringNum-- >=0) if (!GetString(Str,MaxLength)) { RetCode=false; break; } RestorePosition(); return RetCode; } #endif wchar* StringList::GetString() { wchar *Str; GetString(&Str); return Str; } bool StringList::GetString(wchar **Str) { if (CurPos>=StringData.Size()) // No more strings left unprocessed. { if (Str!=NULL) *Str=NULL; return false; } wchar *CurStr=&StringData[CurPos]; CurPos+=wcslen(CurStr)+1; if (Str!=NULL) *Str=CurStr; return true; } void StringList::Rewind() { CurPos=0; } #ifndef SFX_MODULE bool StringList::Search(const wchar *Str,bool CaseSensitive) { SavePosition(); Rewind(); bool Found=false; wchar *CurStr; while (GetString(&CurStr)) { if (Str!=NULL && CurStr!=NULL) if ((CaseSensitive ? wcscmp(Str,CurStr):wcsicomp(Str,CurStr))!=0) continue; Found=true; break; } RestorePosition(); return Found; } #endif #ifndef SFX_MODULE void StringList::SavePosition() { if (SavePosNumber<ASIZE(SaveCurPos)) { SaveCurPos[SavePosNumber]=CurPos; SavePosNumber++; } } #endif #ifndef SFX_MODULE void StringList::RestorePosition() { if (SavePosNumber>0) { SavePosNumber--; CurPos=SaveCurPos[SavePosNumber]; } } #endif |