[Libreoffice-commits] .: l10ntools/source
Thomas Arnhold
tarnhold at kemper.freedesktop.org
Tue Aug 2 17:18:59 PDT 2011
l10ntools/source/help/HelpCompiler.cxx | 53 ------------------------------
l10ntools/source/help/HelpCompiler.hxx | 57 ---------------------------------
2 files changed, 110 deletions(-)
New commits:
commit fe4cbca9a788bb34313a2797b578240246f489ff
Author: Thomas Arnhold <thomas at arnhold.org>
Date: Wed Aug 3 02:19:05 2011 +0200
callcatcher: remove unused methods and a little cleanup
diff --git a/l10ntools/source/help/HelpCompiler.cxx b/l10ntools/source/help/HelpCompiler.cxx
index 0c492b1..0c20993 100644
--- a/l10ntools/source/help/HelpCompiler.cxx
+++ b/l10ntools/source/help/HelpCompiler.cxx
@@ -517,63 +517,10 @@ namespace fs
osl::Directory::createPath(indexDirName.data);
}
- void rename(const fs::path &src, const fs::path &dest)
- {
- osl::File::move(src.data, dest.data);
- }
-
void copy(const fs::path &src, const fs::path &dest)
{
osl::File::copy(src.data, dest.data);
}
-
- bool exists(const fs::path &in)
- {
- osl::File tmp(in.data);
- return (tmp.open(osl_File_OpenFlag_Read) == osl::FileBase::E_None);
- }
-
- void remove(const fs::path &in)
- {
- osl::File::remove(in.data);
- }
-
- void removeRecursive(rtl::OUString const& _suDirURL)
- {
- {
- osl::Directory aDir(_suDirURL);
- aDir.open();
- if (aDir.isOpen())
- {
- osl::DirectoryItem aItem;
- osl::FileStatus aStatus(osl_FileStatus_Mask_FileName | osl_FileStatus_Mask_Attributes);
- while (aDir.getNextItem(aItem) == ::osl::FileBase::E_None)
- {
- if (osl::FileBase::E_None == aItem.getFileStatus(aStatus) &&
- aStatus.isValid(osl_FileStatus_Mask_FileName | osl_FileStatus_Mask_Attributes))
- {
- rtl::OUString suFilename = aStatus.getFileName();
- rtl::OUString suFullFileURL;
- suFullFileURL += _suDirURL;
- suFullFileURL += rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("/"));
- suFullFileURL += suFilename;
-
- if (aStatus.getFileType() == osl::FileStatus::Directory)
- removeRecursive(suFullFileURL);
- else
- osl::File::remove(suFullFileURL);
- }
- }
- aDir.close();
- }
- }
- osl::Directory::remove(_suDirURL);
- }
-
- void remove_all(const fs::path &in)
- {
- removeRecursive(in.data);
- }
}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/l10ntools/source/help/HelpCompiler.hxx b/l10ntools/source/help/HelpCompiler.hxx
index 215a8eb..dd10cc0 100644
--- a/l10ntools/source/help/HelpCompiler.hxx
+++ b/l10ntools/source/help/HelpCompiler.hxx
@@ -60,8 +60,6 @@
#include <compilehelp.hxx>
-#define EMULATEORIGINAL 1
-
#if OSL_DEBUG_LEVEL > 2
#define HCDBG(foo) do { if (1) foo; } while(0)
#else
@@ -141,11 +139,7 @@ namespace fs
};
void create_directory(const fs::path indexDirName);
- void rename(const fs::path &src, const fs::path &dest);
void copy(const fs::path &src, const fs::path &dest);
- bool exists(const fs::path &in);
- void remove_all(const fs::path &in);
- void remove(const fs::path &in);
}
struct joaat_hash
@@ -170,57 +164,6 @@ struct joaat_hash
#define get16bits(d) ((((sal_uInt32)(((const sal_uInt8 *)(d))[1])) << 8)\
+(sal_uInt32)(((const sal_uInt8 *)(d))[0]) )
-struct SuperFastHash
-{
- size_t operator()(const std::string &str) const
- {
- const char * data = str.data();
- int len = str.size();
- size_t hash = len, tmp;
- if (len <= 0 || data == NULL) return 0;
-
- int rem = len & 3;
- len >>= 2;
-
- /* Main loop */
- for (;len > 0; len--)
- {
- hash += get16bits (data);
- tmp = (get16bits (data+2) << 11) ^ hash;
- hash = (hash << 16) ^ tmp;
- data += 2*sizeof (sal_uInt16);
- hash += hash >> 11;
- }
-
- /* Handle end cases */
- switch (rem)
- {
- case 3: hash += get16bits (data);
- hash ^= hash << 16;
- hash ^= data[sizeof (sal_uInt16)] << 18;
- hash += hash >> 11;
- break;
- case 2: hash += get16bits (data);
- hash ^= hash << 11;
- hash += hash >> 17;
- break;
- case 1: hash += *data;
- hash ^= hash << 10;
- hash += hash >> 1;
- }
-
- /* Force "avalanching" of final 127 bits */
- hash ^= hash << 3;
- hash += hash >> 5;
- hash ^= hash << 4;
- hash += hash >> 17;
- hash ^= hash << 25;
- hash += hash >> 6;
-
- return hash;
- }
-};
-
#define pref_hash joaat_hash
typedef boost::unordered_map<std::string, std::string, pref_hash> Stringtable;
More information about the Libreoffice-commits
mailing list