GnuCashew ~ GnuCash Enabled Web
GCW
Core.h
Go to the documentation of this file.
1 #line 2 "src/Glb/Core.h"
2 
3 #ifndef __GCW_CORE_H___
4 #define __GCW_CORE_H___
5 
6 #include <string>
7 #include <vector>
8 
9 #include <Wt/Json/Object.h>
10 
11 //#define COUT_FLF __FILE__, __LINE__, __FUNCTION__
12 //#define COUT_BEG std::cout << __FILE__ << ":" << __LINE__ << "(" << __PRETTY_FUNCTION__ << ") "
13 //#define COUT_END std::endl
14 //#define COUT_LINE std::cout << __FILE__ << ":" << __LINE__ << "(" << __PRETTY_FUNCTION__ << ")" << COUT_END
15 //#define COUT_(x) COUT_BEG << x << COUT_END
16 
17 
18 namespace GCW {
19 
20  /*!
21  ** \brief helper functions and features
22  **
23  */
24  namespace Core {
25 
26 
27 std::vector<std::string> split( const std::string & value, char delim );
28 
29 extern const char* trim_ws;
30 std::string & rtrim( std::string & s, const char* t = trim_ws );
31 std::string & ltrim( std::string & s, const char* t = trim_ws );
32 std::string & trim( std::string & s, const char* t = trim_ws );
33 std::string toupper( const std::string & s );
34 std::string tolower( const std::string & s );
35 
36 Wt::Json::Object toJson( Wt::WTreeView * _view );
37 
38 std::string hexDump( const std::string & data, int start = -1, int end = -1 );
39 
40 /*!
41 ** \brief Generate new GUID string value
42 **
43 ** This GUID is suitable for use as the primary-guid-key value for the
44 ** data tables.
45 **
46 */
47 auto newGuid()-> std::string ;
48 
49 /*!
50 ** \brief Current Date/Time
51 **
52 ** This will return the current date/time suitable for back-end storage
53 **
54 */
55 auto currentDateTime()-> Wt::WDateTime ;
56 auto currentDateTimeStorageString()-> std::string ;
57 
58  } // endnamespace Core
59 } // endnamespace GCW
60 
61 #endif
62 
const char * trim_ws
Definition: Core.cpp:37
std::string toupper(const std::string &s)
Definition: Core.cpp:67
auto currentDateTime() -> Wt::WDateTime
Current Date/Time.
Definition: Core.cpp:260
std::string tolower(const std::string &s)
Definition: Core.cpp:78
std::vector< std::string > split(const std::string &value, char delim)
Definition: Core.cpp:30
std::string & trim(std::string &s, const char *t=trim_ws)
Definition: Core.cpp:60
std::string & ltrim(std::string &s, const char *t=trim_ws)
Definition: Core.cpp:51
std::string hexDump(const std::string &data, int start=-1, int end=-1)
Definition: Core.cpp:170
std::string & rtrim(std::string &s, const char *t=trim_ws)
Definition: Core.cpp:42
Wt::Json::Object toJson(Wt::WTreeView *_view)
Definition: Core.cpp:148
auto newGuid() -> std::string
Generate new GUID string value.
Definition: Core.cpp:235
auto currentDateTimeStorageString() -> std::string
Definition: Core.cpp:280
Definition: App.h:17