summaryrefslogtreecommitdiffstats
path: root/l10ntools
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2012-01-25 21:01:10 +0000
committerCaolán McNamara <caolanm@redhat.com>2012-01-26 11:10:40 +0000
commit1f26095e9c4f72f7bd6e78416c409f68ceae3027 (patch)
tree50d184c814f839845ac1073510304a77c2c34ebd /l10ntools
parentByteString->rtl::OString (diff)
downloadcore-1f26095e9c4f72f7bd6e78416c409f68ceae3027.tar.gz
core-1f26095e9c4f72f7bd6e78416c409f68ceae3027.zip
convert maps and sets to OString
Diffstat (limited to 'l10ntools')
-rw-r--r--l10ntools/inc/export.hxx43
-rw-r--r--l10ntools/inc/tagtest.hxx20
-rw-r--r--l10ntools/inc/xmlparse.hxx10
-rw-r--r--l10ntools/source/merge.cxx4
4 files changed, 16 insertions, 61 deletions
diff --git a/l10ntools/inc/export.hxx b/l10ntools/inc/export.hxx
index de4057ca73de..e3ca6f02d350 100644
--- a/l10ntools/inc/export.hxx
+++ b/l10ntools/inc/export.hxx
@@ -56,46 +56,21 @@
#define NO_TRANSLATE_ISO "x-no-translate"
-#define JAPANESE_ISO "ja"
-
-
-struct eqstr{
- sal_Bool operator()(const char* s1, const char* s2) const{
- return strcmp(s1,s2)==0;
- }
-};
-
-struct equalByteString{
- bool operator()( const ByteString& rKey1, const ByteString& rKey2 ) const {
- return rKey1.CompareTo( rKey2 )==COMPARE_EQUAL;
- }
-};
-struct lessByteString{
- bool operator()( const ByteString& rKey1, const ByteString& rKey2 ) const {
- return rKey1.CompareTo( rKey2 )==COMPARE_LESS;
- }
-};
-
-struct hashByteString{
- size_t operator()( const ByteString& rName ) const{
- return rtl_str_hashCode_WithLength(rName.GetBuffer(), rName.Len() );
- }
-};
-
class PFormEntrys;
class MergeData;
-typedef std::set<ByteString , lessByteString > ByteStringSet;
+typedef std::set<rtl::OString> ByteStringSet;
-typedef boost::unordered_map<rtl::OString, rtl::OString, rtl::OStringHash> ByteStringHashMap;
+typedef boost::unordered_map<rtl::OString, rtl::OString, rtl::OStringHash>
+ ByteStringHashMap;
-typedef boost::unordered_map<ByteString , bool , hashByteString,equalByteString>
- ByteStringBoolHashMap;
+typedef boost::unordered_map<rtl::OString, bool, rtl::OStringHash>
+ ByteStringBoolHashMap;
-typedef boost::unordered_map<ByteString , PFormEntrys* , hashByteString,equalByteString>
- PFormEntrysHashMap;
+typedef boost::unordered_map<rtl::OString, PFormEntrys*, rtl::OStringHash>
+ PFormEntrysHashMap;
-typedef boost::unordered_map<ByteString , MergeData* , hashByteString,equalByteString>
- MergeDataHashMap;
+typedef boost::unordered_map<rtl::OString, MergeData*, rtl::OStringHash>
+ MergeDataHashMap;
#define SOURCE_LANGUAGE ByteString("en-US")
#define LIST_REFID "LIST_REFID"
diff --git a/l10ntools/inc/tagtest.hxx b/l10ntools/inc/tagtest.hxx
index 1a41f508533f..95ce00939851 100644
--- a/l10ntools/inc/tagtest.hxx
+++ b/l10ntools/inc/tagtest.hxx
@@ -44,25 +44,7 @@ typedef ::std::vector< ParserMessage* > Impl_ParserMessageList;
class ParserMessageList;
-struct equalByteString{
- bool operator()( const ByteString& rKey1, const ByteString& rKey2 ) const {
- return rKey1.CompareTo( rKey2 )==COMPARE_EQUAL;
- }
-};
-struct lessByteString{
- bool operator()( const ByteString& rKey1, const ByteString& rKey2 ) const {
- return rKey1.CompareTo( rKey2 )==COMPARE_LESS;
- }
-};
-
-struct hashByteString{
- size_t operator()( const ByteString& rName ) const{
- return rtl_str_hashCode(rName.GetBuffer());
- }
-};
-
-typedef boost::unordered_map<ByteString , String , hashByteString,equalByteString>
- StringHashMap;
+typedef boost::unordered_map<rtl::OString, String, rtl::OStringHash> StringHashMap;
class TokenInfo
{
diff --git a/l10ntools/inc/xmlparse.hxx b/l10ntools/inc/xmlparse.hxx
index 2491edab761d..c6fe74055080 100644
--- a/l10ntools/inc/xmlparse.hxx
+++ b/l10ntools/inc/xmlparse.hxx
@@ -185,18 +185,16 @@ public:
//-------------------------------------------------------------------------
/// Mapping numeric Language code <-> XML Element
-typedef boost::unordered_map< ByteString ,XMLElement* , hashByteString,equalByteString > LangHashMap;
+typedef boost::unordered_map<rtl::OString, XMLElement*, rtl::OStringHash> LangHashMap;
/// Mapping XML Element string identifier <-> Language Map
-typedef boost::unordered_map<ByteString , LangHashMap* ,
- hashByteString,equalByteString> XMLHashMap;
+typedef boost::unordered_map<rtl::OString, LangHashMap*, rtl::OStringHash> XMLHashMap;
/// Mapping iso alpha string code <-> iso numeric code
-typedef boost::unordered_map<ByteString, int, hashByteString,equalByteString> HashMap;
+typedef boost::unordered_map<rtl::OString, int, rtl::OStringHash> HashMap;
/// Mapping XML tag names <-> have localizable strings
-typedef boost::unordered_map<ByteString , sal_Bool ,
- hashByteString,equalByteString> TagMap;
+typedef boost::unordered_map<rtl::OString, sal_Bool, rtl::OStringHash> TagMap;
/** Holds information of a XML file, is root node of tree
*/
diff --git a/l10ntools/source/merge.cxx b/l10ntools/source/merge.cxx
index 7da6452884df..6015a66e3b15 100644
--- a/l10ntools/source/merge.cxx
+++ b/l10ntools/source/merge.cxx
@@ -142,7 +142,7 @@ ByteString MergeData::Dump(){
PFormEntrysHashMap::const_iterator idbg;
for( idbg = aMap.begin() ; idbg != aMap.end(); ++idbg )
{
- printf("aMap[ %s ] = " ,idbg->first.GetBuffer());
+ printf("aMap[ %s ] = " ,idbg->first.getStr());
( (PFormEntrys*)(idbg->second) )->Dump();
printf("\n");
}
@@ -249,7 +249,7 @@ ByteString MergeDataFile::Dump(){
MergeDataHashMap::const_iterator idbg;
for( idbg = aMap.begin() ; idbg != aMap.end(); ++idbg )
{
- printf("aMap[ %s ] = ",idbg->first.GetBuffer());
+ printf("aMap[ %s ] = ",idbg->first.getStr());
idbg->second->Dump();
printf("\n");
}