ffead.server.doc
AfcUtil.h
1 /*
2  Copyright 2009-2012, Sumeet Chhetri
3 
4  Licensed under the Apache License, Version 2.0 (the "License");
5  you may not use this file except in compliance with the License.
6  You may obtain a copy of the License at
7 
8  http://www.apache.org/licenses/LICENSE-2.0
9 
10  Unless required by applicable law or agreed to in writing, software
11  distributed under the License is distributed on an "AS IS" BASIS,
12  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  See the License for the specific language governing permissions and
14  limitations under the License.
15 */
16 /*
17  * AfcUtil.h
18  *
19  * Created on: Aug 27, 2009
20  * Author: sumeet
21  */
22 
23 
24 #include "Reflection.h"
25 #include "Constants.h"
26 #include "HttpRequest.h"
27 #include "CastUtil.h"
28 #include "Logger.h"
29 #include "HttpResponse.h"
30 #include "HTTPResponseStatus.h"
31 
32 
33 #ifndef AFCUTIL_H_
34 #define AFCUTIL_H_
35 
36 class AfcUtil {
37  static Logger logger;
38 public:
39  AfcUtil();
40  virtual ~AfcUtil();
41  static string generateJsObjects(strVec,string,string&,string,string &,strVec,bool,string&,strVec);
42  static string generateJsInterfaces(strVec,string,string&,string,string &,string,map<string, string>);
43  static string updateAjaxInterface(strVec,string,string,string,string);
44  static void writeTofile(string,string,bool);
45  static void execute(HttpRequest,HttpResponse*,string);
46  static string camelCased(const string&);
47  static string reverseCamelCased(const string&);
48  static string generateJsObjectsAll(vector<string>,strVec,vector<bool>,string &,string &,string &,vector<string>,string&,string&,map<string, string>);
49  static string generateReadObjects(string type, string name, bool priv, bool ptr, string typ);
50  static string generateReadVectorObjects(string type, string name, bool priv, bool ptr, string typ, string conttype);
51  static string generateToJSONObjects(string type, string name, bool priv, strVec obj, int i, string &retu, string &headers, string path, string &objs, string typ, bool ptr);
52  static string generateToJSONVectorObjects(string type, string name, bool priv, string &retu, string &headers, string path, string &objs, string typ, bool ptr, string stlcnttyp);
53 };
54 
55 #endif /* AFCUTIL_H_ */