File: CSUseful.h

package info (click to toggle)
openems 0.0.35%2Bdfsg.1-3
  • links: PTS, VCS
  • area: main
  • in suites: buster
  • size: 6,288 kB
  • sloc: cpp: 40,259; yacc: 580; lex: 350; makefile: 258; sh: 169; ruby: 19
file content (41 lines) | stat: -rw-r--r-- 1,395 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
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