Changeset 677
- Timestamp:
- 11/17/14 15:33:15 (5 years ago)
- Location:
- branches/work_320
- Files:
-
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/work_320/ARInside.vcproj
r666 r677 25 25 IntermediateDirectory="$(ConfigurationName)\$(ProjectName)" 26 26 ConfigurationType="1" 27 CharacterSet=" 2"27 CharacterSet="1" 28 28 > 29 29 <Tool … … 45 45 Name="VCCLCompilerTool" 46 46 Optimization="0" 47 AdditionalIncludeDirectories="..\..\api810\include;.\;..\..\libs\zlib\include "47 AdditionalIncludeDirectories="..\..\api810\include;.\;..\..\libs\zlib\include;thirdparty\breakpad\src" 48 48 PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE;ARINSIDE_BREAKPAD_SUPPORT" 49 49 MinimalRebuild="true" … … 122 122 Name="VCCLCompilerTool" 123 123 Optimization="0" 124 AdditionalIncludeDirectories="..\..\api810\include;.\;..\..\libs\zlib\include; "thirdparty\breakpad\src""124 AdditionalIncludeDirectories="..\..\api810\include;.\;..\..\libs\zlib\include;thirdparty\breakpad\src" 125 125 PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE;ARINSIDE_BREAKPAD_SUPPORT" 126 126 MinimalRebuild="true" … … 177 177 IntermediateDirectory="$(ConfigurationName)\$(ProjectName)" 178 178 ConfigurationType="1" 179 CharacterSet=" 2"179 CharacterSet="1" 180 180 WholeProgramOptimization="1" 181 181 > … … 199 199 Optimization="2" 200 200 EnableIntrinsicFunctions="true" 201 AdditionalIncludeDirectories="..\..\api810\include;.\;..\..\libs\zlib\include "201 AdditionalIncludeDirectories="..\..\api810\include;.\;..\..\libs\zlib\include;thirdparty\breakpad\src" 202 202 PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE;ARINSIDE_BREAKPAD_SUPPORT" 203 203 RuntimeLibrary="2" 204 204 EnableFunctionLevelLinking="true" 205 205 UsePrecompiledHeader="2" 206 PrecompiledHeaderThrough="ARInsideMain.h" 206 207 WarningLevel="3" 207 208 DebugInformationFormat="3" … … 277 278 Optimization="2" 278 279 EnableIntrinsicFunctions="true" 279 AdditionalIncludeDirectories="..\..\api810\include;.\;..\..\libs\zlib\include; "thirdparty\breakpad\src""280 AdditionalIncludeDirectories="..\..\api810\include;.\;..\..\libs\zlib\include;thirdparty\breakpad\src" 280 281 PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE;ARINSIDE_BREAKPAD_SUPPORT" 281 282 RuntimeLibrary="2" … … 333 334 IntermediateDirectory="$(ConfigurationName)\$(ProjectName)" 334 335 ConfigurationType="1" 335 CharacterSet=" 2"336 CharacterSet="1" 336 337 WholeProgramOptimization="1" 337 338 > … … 355 356 Optimization="2" 356 357 EnableIntrinsicFunctions="true" 357 AdditionalIncludeDirectories="..\..\api810\include;.\;..\..\libs\zlib\include "358 AdditionalIncludeDirectories="..\..\api810\include;.\;..\..\libs\zlib\include;thirdparty\breakpad\src" 358 359 PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE;ARINSIDE_BREAKPAD_SUPPORT" 359 360 RuntimeLibrary="2" … … 410 411 IntermediateDirectory="$(PlatformName)\$(ConfigurationName)\$(ProjectName)" 411 412 ConfigurationType="1" 412 CharacterSet=" 2"413 CharacterSet="1" 413 414 WholeProgramOptimization="1" 414 415 > … … 433 434 Optimization="2" 434 435 EnableIntrinsicFunctions="true" 435 AdditionalIncludeDirectories="..\..\api810\include;.\;..\..\libs\zlib\include "436 AdditionalIncludeDirectories="..\..\api810\include;.\;..\..\libs\zlib\include;thirdparty\breakpad\src" 436 437 PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE;ARINSIDE_BREAKPAD_SUPPORT" 437 438 RuntimeLibrary="2" -
branches/work_320/lists/support/BasicStringList.cpp
r675 r677 40 40 41 41 strncpy(list->nameList[list->numItems], &value[skippedSpaces], AR_MAX_NAME_SIZE); 42 MakeLower(list->nameList[list->numItems]); 42 43 list->nameList[list->numItems][AR_MAX_NAME_SIZE] = 0; 43 44 list->numItems++; … … 50 51 51 52 strncpy(list->nameList[list->numItems], (value.c_str() + skippedSpaces), AR_MAX_NAME_SIZE); 53 MakeLower(list->nameList[list->numItems]); 52 54 list->nameList[list->numItems][AR_MAX_NAME_SIZE] = 0; 53 55 list->numItems++; … … 58 60 return (strcoll(list->nameList[l], list->nameList[r]) < 0); 59 61 } 62 63 void BasicStringList::MakeLower(ARNameType &name) 64 { 65 for (unsigned int idx = 0; idx < AR_MAX_NAME_SIZE; ++idx) 66 { 67 char c = name[idx]; 68 if (c == 0) break; 69 name[idx] = tolower(c); 70 } 71 } -
branches/work_320/lists/support/BasicStringList.h
r675 r677 32 32 33 33 ARNameList *list; 34 35 private: 36 void MakeLower(ARNameType &value); 34 37 }; -
branches/work_320/lists/support/IndexSorterTest.cpp
r675 r677 31 31 testList.push_back("\xc3\x81ndre"); 32 32 testList.push_back("B\xc3\xbcro"); 33 testList.push_back("ugly"); 33 34 34 35 vector<int> indexList; … … 39 40 indexList.push_back(4); // this is the index of testList's "Ándre" value 40 41 indexList.push_back(5); // this is the index of testList's "Büro" value 42 indexList.push_back(6); // this is the index of testList's "ugly" value 41 43 42 44 IndexSorter indexSorter(true); 43 45 indexSorter.SortBy(testList).Sort(indexList); 44 46 45 ASSERT_EQ(4, indexList[0]); // the value of "Ándre" 46 ASSERT_EQ(5, indexList[1]); // the value of "Büro" 47 ASSERT_EQ(3, indexList[2]); // the value of "Hallo Welt" 48 ASSERT_EQ(2, indexList[3]); // the value of "Überschrift" 49 ASSERT_EQ(0, indexList[4]); // the value of "Umgang" 50 ASSERT_EQ(1, indexList[5]); // the value of "Wartung" 47 ASSERT_EQ(4, indexList[0]); // the value of "ándre" 48 ASSERT_EQ(5, indexList[1]); // the value of "büro" 49 ASSERT_EQ(3, indexList[2]); // the value of "hallo welt" 50 ASSERT_EQ(2, indexList[3]); // the value of "überschrift" 51 ASSERT_EQ(6, indexList[4]); // the value of "ugly" 52 ASSERT_EQ(0, indexList[5]); // the value of "umgang" 53 ASSERT_EQ(1, indexList[6]); // the value of "wartung" 51 54 } -
branches/work_320/lists/support/UTF8StringList.cpp
r675 r677 22 22 UTF8StringList::UTF8StringList() 23 23 #ifdef WIN32 24 : systemLocale(""), coll(std::use_facet<std::collate<sort_char_t> >(systemLocale)) 24 #define UTF8_SORT_LOCALE systemLocale 25 : systemLocale(""), coll(std::use_facet<std::collate<sort_char_t> >(UTF8_SORT_LOCALE)) 25 26 #else 26 : coll(std::use_facet<std::collate<char> >(localeDetection.sortLocale)) 27 #define UTF8_SORT_LOCALE localeDetection.sortLocale 28 : coll(std::use_facet<std::collate<char> >(UTF8_SORT_LOCALE)) 27 29 #endif 28 30 { … … 40 42 41 43 #ifdef WIN32 42 vector<wchar_t> wideString; 44 std::wstring wideString; 45 wideString.reserve(AR_MAX_NAME_SIZE + 1); 43 46 utf8::utf8to16(&value[skippedSpaces], &value[strlen(value)], back_inserter(wideString)); 44 wideString.push_back(0); 45 46 wchar_t *uStr = &wideString[0]; 47 list.push_back(uStr); 47 MakeLower(wideString); 48 49 list.push_back(wideString); 48 50 #else 49 51 list.push_back(&value[skippedSpaces]); … … 57 59 58 60 #ifdef WIN32 59 vector<wchar_t> wideString; 61 std::wstring wideString; 62 wideString.reserve(AR_MAX_NAME_SIZE + 1); 60 63 utf8::utf8to16(value.begin() + skippedSpaces, value.end(), back_inserter(wideString)); 61 wideString.push_back(0);64 MakeLower(wideString); 62 65 63 wchar_t *uStr = &wideString[0]; 64 list.push_back(uStr); 66 list.push_back(wideString); 65 67 #else 66 68 list.push_back(value.c_str() + skippedSpaces); … … 75 77 ) < 0); 76 78 } 79 80 UTF8StringList::sort_char_t UTF8StringList::operator () (sort_char_t c) 81 { 82 return std::tolower(c, UTF8_SORT_LOCALE); 83 } 84 85 void UTF8StringList::MakeLower(list_string_t &str) 86 { 87 std::transform(str.begin(), str.end(), str.begin(), *this); 88 } -
branches/work_320/lists/support/UTF8StringList.h
r675 r677 18 18 19 19 #include "InternalNameList.h" 20 #ifndef WIN32 21 #include "LocaleDetector.h" 22 #endif 20 23 21 24 class UTF8StringList : public InternalNameList … … 46 49 47 50 bool operator()(int l, int r); 51 sort_char_t operator() (sort_char_t c); 48 52 49 53 vector<list_string_t> list; 54 55 private: 56 void MakeLower(list_string_t &str); 50 57 }; -
branches/work_320/stdafx.h
r636 r677 32 32 #include <functional> 33 33 #include <assert.h> 34 #include <stdexcept> 34 35 35 36 #ifdef WIN32 // JLS17 LINUX
Note: See TracChangeset
for help on using the changeset viewer.