summaryrefslogtreecommitdiff
path: root/shared/global_func.h
diff options
context:
space:
mode:
Diffstat (limited to 'shared/global_func.h')
-rw-r--r--shared/global_func.h31
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
bgstack15