forked from jasp-stats/jasp-desktop
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcolumnutils.h
32 lines (24 loc) · 1.16 KB
/
columnutils.h
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
#ifndef COLUMNUTILS_H
#define COLUMNUTILS_H
#include <string>
#include "utils.h"
class ColumnUtils
{
public:
friend class PreferencesModel;
static bool getIntValue( const std::string & value, int & intValue);
static bool getIntValue( const double & value, int & intValue);
static bool getDoubleValue( const std::string & value, double & doubleValue);
static doubleset getDoubleValues(const stringset & values, bool stripNAN = true);
static bool isIntValue( const std::string & value);
static bool isDoubleValue( const std::string & value);
static void convertEscapedUnicodeToUTF8( std::string & inputStr);
static std::string deEuropeaniseForImport( std::string value); //Convert a string to a double with a dot for a separator
static std::string doubleToString( double dbl, int precision = 10);
static std::string doubleToStringMaxPrec( double dbl);
static bool convertVecToInt( const stringvec & values, intvec & intValues, intset & uniqueValues);
static bool convertVecToDouble( const stringvec & values, doublevec & doubleValues);
private:
static std::string _convertEscapedUnicodeToUTF8( std::string hex);
};
#endif // COLUMNUTILS_H