diff options
author | Daniel Wilhelm <daniel@wili.li> | 2014-04-18 17:12:46 +0200 |
---|---|---|
committer | Daniel Wilhelm <daniel@wili.li> | 2014-04-18 17:12:46 +0200 |
commit | b338e29fd3eaf700f8c8360aa0310048ba941d54 (patch) | |
tree | 122f8ef3790d12cd10275ef7453a9e8053322d78 /shared/global_func.h | |
parent | 3.18 (diff) | |
download | FreeFileSync-b338e29fd3eaf700f8c8360aa0310048ba941d54.tar.gz FreeFileSync-b338e29fd3eaf700f8c8360aa0310048ba941d54.tar.bz2 FreeFileSync-b338e29fd3eaf700f8c8360aa0310048ba941d54.zip |
3.19
Diffstat (limited to 'shared/global_func.h')
-rw-r--r-- | shared/global_func.h | 31 |
1 files changed, 7 insertions, 24 deletions
diff --git a/shared/global_func.h b/shared/global_func.h index 1c6bf0ae..bf9f13dd 100644 --- a/shared/global_func.h +++ b/shared/global_func.h @@ -12,8 +12,6 @@ #include <vector> #include <set> #include <wx/string.h> -//#include <memory> -//#include <sstream> namespace common @@ -37,28 +35,8 @@ ForwardIterator custom_binary_search(ForwardIterator first, ForwardIterator last //############################################################################ -class wxFile; -class DebugLog -{ -public: - wxDEPRECATED(DebugLog(const wxString& filePrefix = wxString())); - ~DebugLog(); - void write(const wxString& logText); - -private: - wxString assembleFileName(); - wxString logfileName; - wxString prefix; - int lineCount; - wxFile* logFile; //logFile.close(); <- not needed -}; -extern DebugLog logDebugInfo; -wxString getCodeLocation(const wxString& file, int line); -//small macro for writing debug information into a logfile -#define WRITE_DEBUG_LOG(x) logDebugInfo.write(getCodeLocation(__TFILE__, __LINE__) + x); -//speed alternative: wxLogDebug(wxT("text")) + DebugView @@ -78,9 +56,14 @@ wxString getCodeLocation(const wxString& file, int line); +//---------------Inline Implementation--------------------------------------------------- +inline +size_t common::getDigitCount(size_t number) //count number of digits +{ + return number == 0 ? 1 : static_cast<size_t>(::log10(static_cast<double>(number))) + 1; +} -//---------------Inline Implementation--------------------------------------------------- //Note: the following lines are a performance optimization for deleting elements from a vector: linear runtime at most! template <class T> void common::removeRowsFromVector(const std::set<size_t>& rowsToRemove, std::vector<T>& grid) @@ -126,4 +109,4 @@ ForwardIterator common::custom_binary_search(ForwardIterator first, ForwardItera return last; } -#endif // GLOBALFUNCTIONS_H_INCLUDED
\ No newline at end of file +#endif // GLOBALFUNCTIONS_H_INCLUDED |