Browse Source

Added vector -> json, and some misc includes for sublime clang

master
Joshua Moerman 12 years ago
parent
commit
3784dde396
  1. 10
      beats-server.sublime-project
  2. 9
      src/json_ext.h

10
beats-server.sublime-project

@ -10,12 +10,20 @@
{ {
"sublimeclang_options": "sublimeclang_options":
[ [
"-isystem/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.7.sdk",
"-isystem/Users/joshua/Documents/Code/libcxx/include/", "-isystem/Users/joshua/Documents/Code/libcxx/include/",
"-isystem${folder:${project_path:beats-server.sublime-project}}/contrib/libwebsockets/", "-isystem${folder:${project_path:beats-server.sublime-project}}/contrib/libwebsockets/",
"-isystem${folder:${project_path:beats-server.sublime-project}}/contrib/json-spirit/include", "-isystem${folder:${project_path:beats-server.sublime-project}}/contrib/json-spirit/include",
"-isystem/usr/local/include",
"-isystem/sw/include",
"-isystem/opt/local/include",
"-isystem/usr/include",
"-I${folder:${project_path:beats-server.sublime-project}}",
"-I${folder:${project_path:beats-server.sublime-project}}/src",
"-Wall", "-Wall",
"-std=c++11", "-std=c++11",
"-stdlib=libc++" "-stdlib=libc++",
"-ferror-limit=0"
] ]
} }
} }

9
src/json_ext.h

@ -10,3 +10,12 @@ inline js::Value ptrvector_to_json(C const & container){
} }
return array; return array;
} }
template <typename C>
inline js::Value vector_to_json(C const & container){
js::Array array;
for(auto x : container){
array.push_back(to_json(x));
}
return array;
}