-
Notifications
You must be signed in to change notification settings - Fork 1
/
ofkXMLProperties.h
executable file
·87 lines (58 loc) · 1.8 KB
/
ofkXMLProperties.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
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
/*
* ofkXMLProperties.h
*
* Created by Shunichi Kasahara on 12/12/28.
* Copyright 2010 __MyCompanyName__. All rights reserved.
*
*/
/*
in Header file :
#include "ofkXMLProperties.h"
in Cpp file:
mySettings.xml
and prepare file with name "xxxxx.xml"
*/
//シングルトン実装
#include "ofMain.h"
//Quick Hack,
#define TARGET_OS_X
#if defined WIN32
#elif defined TARGET_OS_X
#elif defined TARGET_OS_IPHONE || defined TARGET_IPHONE_SIMULATOR
#include "ofxiPhoneExtras.h"
#endif
/*
#if defined TARGET_OS_IPHONE// || defined TARGET_IPHONE_SIMULATOR
#include "ofxiPhoneExtras.h"
#endif
*/
#include "ofxXmlSettings.h"
#ifndef _ofkXMLProperties_H_
#define _ofkXMLProperties_H_
class ofkXMLProperties
{
public:
static bool setXMLFile(const string& fileName);
static bool setLastOpenData();
static int getPropertyValue(const string& tag, int defaultValue);
static float getPropertyValue(const string& tag, float defaultValue);
static string getPropertyValue(const string& tag, const string& defaultValue);
static void setPropertyValue(const string& tag, int value);
static void setPropertyValue(const string& tag, float value);
static void setPropertyValue(const string& tag, const string& value);
//this can be template
//static void setPropertyValueList(const string& tag, const vector < string >& value);
// ----- set and get Macro
static void setPropertyMatrix44f(const string& tag, const ofMatrix4x4& mat);
static ofMatrix4x4 getPropertyMatrix44f(const string& tag);
protected:
static ofkXMLProperties *getInstance();
private:
static ofkXMLProperties *m_pInstance;
static string FileName;
ofxXmlSettings XML;
ofkXMLProperties();
~ofkXMLProperties();
static bool saveXML();
};
#endif //_ofkXMLProperties_H_