1 #line 2 "src/Dbo/Slots.cpp"
3 #include <Wt/Json/Parser.h>
4 #include <Wt/Json/Object.h>
5 #include <Wt/Json/Serializer.h>
42 for(
auto & result : resultList )
43 retVal.push_back( result );
52 get(
const std::string & _guid,
const std::string & _name )
62 Wt::WString(
"\"obj_guid\" = '{1}'" )
71 Wt::WString(
" AND \"name\" = '{1}'" )
99 Wt::Json::Object jobj;
101 Wt::Json::parse(
varField(), jobj );
103 catch( std::exception & e )
105 std::cout << __FILE__ <<
":" << __LINE__ <<
" id:" << this->
id() <<
" " << e.what() << std::endl;
108 retVal = jobj.get( _field ).orIfNull(
"");
118 getVarInt(
const std::string & _field )
const
124 Wt::Json::Object jobj;
126 Wt::Json::parse(
varField(), jobj );
128 catch( std::exception & e )
130 std::cout << __FILE__ <<
":" << __LINE__ <<
" id:" << this->
id() <<
" " << e.what() << std::endl;
133 retVal = jobj.get( _field ).orIfNull( 0 );
143 setVar(
const std::string & _field,
const char * _value )
145 setVar( _field, std::string( _value ) );
151 setVar(
const std::string & _field,
const Wt::WString & _value )
153 setVar( _field, _value.toUTF8() );
159 setVar(
const std::string & _field,
const std::string & _value )
169 Wt::Json::Object jobj;
171 Wt::Json::parse(
varField(), jobj );
174 catch( std::exception & e )
176 std::cout << __FILE__ <<
":" << __LINE__ <<
" id:" << this->
id() <<
" " << e.what() << std::endl;
179 jobj[_field] = Wt::WString( _value );
181 setVarField( Wt::Json::serialize( jobj ) );
187 setVar(
const std::string & _field,
int _value )
197 Wt::Json::Object jobj;
199 Wt::Json::parse(
varField(), jobj );
201 catch( std::exception & e )
203 std::cout << __FILE__ <<
":" << __LINE__ <<
" id:" << this->
id() <<
" " << e.what() << std::endl;
206 jobj[_field] = _value;
208 setVarField( Wt::Json::serialize( jobj ) );
std::vector< Ptr > Vector
int getVarInt(const std::string &_field) const
void setVar(const std::string &_field, const char *_value)
const std::string & varField() const
std::string getVarString(const std::string &_field) const
const Wt::WFormModel::Field id
Wt::WFormModel::Field gdate_val
Wt::WFormModel::Field double_val
Wt::WFormModel::Field obj_guid
Wt::WFormModel::Field int64_val
Wt::WFormModel::Field string_val
Wt::WFormModel::Field timespec_val
Wt::WFormModel::Field numeric_val_num
Wt::WFormModel::Field name
Wt::WFormModel::Field slot_type
Wt::WFormModel::Field guid_val
Wt::WFormModel::Field numeric_val_denom
auto get() -> GCW::Dbo::Slots::Item::Vector
Wt::WFormModel::Field varField