forked from ofZach/projectGeneratorSimple
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathUtils.h
More file actions
62 lines (43 loc) · 1.7 KB
/
Copy pathUtils.h
File metadata and controls
62 lines (43 loc) · 1.7 KB
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
/*
* Utils.h
*
* Created on: 28/12/2011
* Author: arturo
*/
#ifndef UTILS_H_
#define UTILS_H_
#include "ofConstants.h"
#include "pugixml.hpp"
#include "ofMain.h"
string generateUUID(string input);
string getOFRoot();
string getAddonsRoot();
void setOFRoot(string path);
void findandreplace( std::string& tInput, std::string tFind, std::string tReplace );
void findandreplaceInTexfile (string fileName, string tFind, string tReplace );
bool doesTagAndAttributeExist(pugi::xml_document & doc, string tag, string attribute, string newValue);
pugi::xml_node appendValue(pugi::xml_document & doc, string tag, string attribute, string newValue, bool addMultiple = false);
void getFoldersRecursively(const string & path, vector < string > & folderNames, string platform);
void getFilesRecursively(const string & path, vector < string > & fileNames);
void getLibsRecursively(const string & path, vector < string > & libFiles, vector < string > & libLibs, string platform = "" );
void splitFromLast(string toSplit, string deliminator, string & first, string & second);
void splitFromFirst(string toSplit, string deliminator, string & first, string & second);
void parseAddonsDotMake(string path, vector < string > & addons);
void fixSlashOrder(string & toFix);
string unsplitString (vector < string > strings, string deliminator );
string getOFRelPath(string from);
bool checkConfigExists();
bool askOFRoot();
string getOFRootFromConfig();
template <class T>
inline bool isInVector(T item, vector<T> & vec){
bool bIsInVector = false;
for(int i=0;i<vec.size();i++){
if(vec[i] == item){
bIsInVector = true;
break;
}
}
return bIsInVector;
}
#endif /* UTILS_H_ */