GnuCashew ~ Web Application compatible with GnuCash sql data files.
GCW
Loading...
Searching...
No Matches
Vars.h
Go to the documentation of this file.
1#line 2 "src/Dbo/Vars.h"
2
3#ifndef __DBO_VARS_H___
4#define __DBO_VARS_H___
5
6#include "../BaseItem.h"
7#include "Var.h"
8
9/*
10** Predefine the class that fixin to come up.
11**
12*/
13namespace GCW {
14 namespace Dbo {
15 namespace Vars {
16 class Item;
17 }
18 }
19}
20
21/*
22** Now we can start building our class!
23**
24*/
25namespace GCW {
26 namespace Dbo {
27 namespace Vars {
28
29/*!
30** \brief Variables Item Class
31**
32**
33*/
34class Item
35: public GCW::Dbo::BaseItem< Item >
36{
37 public:
38
39 const std::string & keyField () const { return m_keyField ; }
40 const std::string & cfyField () const { return m_cfyField ; }
41 const std::string & varField () const { return m_varField ; }
42
43 void setKeyField( const std::string & _value ) { m_keyField = _value; }
44 void setCfyField( const std::string & _value ) { m_cfyField = _value; }
45 void setVarField( const std::string & _value ) { m_varField = _value; }
46
47 std::string getVarString( const std::string & _field ) const;
48 int getVarInt( const std::string & _field ) const;
49 void setVar( const std::string & _field, const char * _value );
50 void setVar( const std::string & _field, const Wt::WString & _value );
51 void setVar( const std::string & _field, const std::string & _value );
52 void setVar( const std::string & _field, int _value );
53
54 template< class Action > void persist( Action & action )
55 {
59 }
60
61 private:
62
63 std::string m_keyField ;
64 std::string m_cfyField ;
65 std::string m_varField ;
66
67}; // endclass Item
68
69auto get( const std::string & _keyValue, const std::string & _cfyValue = "*", bool _add = true )-> GCW::Dbo::Vars::Item::Ptr ;
70auto getByCfy( const std::string & _cfyValue )-> GCW::Dbo::Vars::Item::Vector ;
71
72extern const char * s_tableName;
73
74 } // endnamespace Vars {
75 } // endnamespace Dbo {
76} // endnamespace GCW {
77
78#endif // end#ifndef __VARS_H___
79
std::vector< Ptr > Vector
Definition BaseItem.h:41
Wt::Dbo::ptr< Item > Ptr
Definition BaseItem.h:39
Variables Item Class.
Definition Vars.h:36
int getVarInt(const std::string &_field) const
Definition Vars.cpp:120
void setVar(const std::string &_field, const char *_value)
Definition Vars.cpp:145
const std::string & cfyField() const
Definition Vars.h:40
void persist(Action &action)
Definition Vars.h:54
const std::string & keyField() const
Definition Vars.h:39
std::string m_cfyField
Definition Vars.h:64
std::string m_keyField
Definition Vars.h:63
std::string m_varField
Definition Vars.h:65
const std::string & varField() const
Definition Vars.h:41
std::string getVarString(const std::string &_field) const
Definition Vars.cpp:95
void setVarField(const std::string &_value)
Definition Vars.h:45
void setKeyField(const std::string &_value)
Definition Vars.h:43
void setCfyField(const std::string &_value)
Definition Vars.h:44
void field(Action &action, V &value, const std::string &name, int size=-1)
Wt::WFormModel::Field varField
Definition Var.cpp:7
Wt::WFormModel::Field cfyField
Definition Var.cpp:6
Wt::WFormModel::Field keyField
Definition Var.cpp:5
auto getByCfy(const std::string &_cfyValue) -> GCW::Dbo::Vars::Item::Vector
Definition Vars.cpp:75
auto get(const std::string &_keyValue, const std::string &_cfyValue="*", bool _add=true) -> GCW::Dbo::Vars::Item::Ptr
Definition Vars.cpp:16
const char * s_tableName
Definition Vars.cpp:11
Definition App.h:18