summaryrefslogtreecommitdiff
path: root/CSXCAD/src/CSUseful.h
diff options
context:
space:
mode:
authorRuben Undheim <ruben.undheim@gmail.com>2016-07-05 18:02:38 +0200
committerRuben Undheim <ruben.undheim@gmail.com>2016-07-05 18:02:38 +0200
commitef962f6008f25ab7cbd4ca21bcc72b97a1e2d76f (patch)
tree8149bee93d1a3f91d4503bfb3853adac4af0a85e /CSXCAD/src/CSUseful.h
Imported Upstream version 0.0.34
Diffstat (limited to 'CSXCAD/src/CSUseful.h')
-rw-r--r--CSXCAD/src/CSUseful.h41
1 files changed, 41 insertions, 0 deletions
diff --git a/CSXCAD/src/CSUseful.h b/CSXCAD/src/CSUseful.h
new file mode 100644
index 0000000..bcb64cb
--- /dev/null
+++ b/CSXCAD/src/CSUseful.h
@@ -0,0 +1,41 @@
+#ifndef CSUSEFUL_H
+#define CSUSEFUL_H
+
+class CSDebug;
+
+#include "CSXCAD_Global.h"
+#include <vector>
+#include <stdio.h>
+#include <stdlib.h>
+#include <string>
+#include <iostream>
+
+std::string CSXCAD_EXPORT ConvertInt(int number);
+int CSXCAD_EXPORT String2Int(std::string number);
+double CSXCAD_EXPORT String2Double(std::string number, bool &ok, int accurarcy=15);
+std::vector<double> CSXCAD_EXPORT SplitString2Double(std::string str, const char delimiter);
+std::vector<std::string> CSXCAD_EXPORT SplitString2Vector(std::string str, const char delimiter);
+std::string CSXCAD_EXPORT CombineVector2String(std::vector<double> values, const char delimiter, int accurarcy=15);
+std::string CSXCAD_EXPORT CombineArray2String(double* values, unsigned int numVal, const char delimiter, int accurarcy=15);
+std::string CSXCAD_EXPORT CombineArray2String(float* values, unsigned int numVal, const char delimiter, int accurarcy=15);
+std::string CSXCAD_EXPORT CombineArray2String(int* values, unsigned int numVal, const char delimiter, int accurarcy=15);
+
+std::vector<int> CSXCAD_EXPORT SplitString2Int(std::string str, const char delimiter);
+
+class CSXCAD_EXPORT CSDebug
+{
+public:
+ CSDebug();
+
+ void SetLevel(int level) {m_level=level;}
+
+ void Debug(int on_level, const char* message);
+ void Debug(int on_level, std::string message);
+
+protected:
+ int m_level;
+};
+
+static CSDebug g_CSDebug;
+
+#endif // CSUSEFUL_H