Changeset 297
- Timestamp:
- 02/06/05 18:42:04 (4 years ago)
- Files:
-
- todo2/trunk/configure.in (modified) (2 diffs)
- todo2/trunk/doc (modified) (1 prop)
- todo2/trunk/NOTES (added)
- todo2/trunk/src (modified) (1 prop)
- todo2/trunk/src/backend (modified) (1 prop)
- todo2/trunk/src/config.h.in (modified) (5 diffs)
- todo2/trunk/src/contactmethod (modified) (1 prop)
- todo2/trunk/src/filter (modified) (1 prop)
- todo2/trunk/src/filter/Expression.cc (modified) (3 diffs)
- todo2/trunk/src/frontend (modified) (1 prop)
- todo2/trunk/src/main.cc (modified) (2 diffs)
- todo2/trunk/src/main.h (modified) (1 diff)
- todo2/trunk/src/Makefile.am (modified) (2 diffs)
- todo2/trunk/src/Manager.cc (modified) (1 diff)
- todo2/trunk/src/PropertyMap.cc (modified) (3 diffs)
- todo2/trunk/src/PropertyMap.h (modified) (3 diffs)
- todo2/trunk/src/Scope.cc (deleted)
- todo2/trunk/src/Scope.h (deleted)
- todo2/trunk/src/User.cc (modified) (1 diff)
- todo2/trunk/src/User.h (modified) (2 diffs)
- todo2/trunk/.todo (modified) (2 diffs)
- todo2/trunk/.todo2 (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
todo2/trunk/configure.in
r295 r297 32 32 33 33 AC_LANG([C++]) 34 AC_PROG_CXX35 34 AC_PROG_INSTALL 36 35 AC_PROG_LN_S … … 100 99 101 100 AC_CONFIG_HEADERS([src/config.h]) 102 AC_ OUTPUT([Makefile doc/Makefile src/Makefile src/filter/Makefile \101 AC_CONFIG_FILES([Makefile doc/Makefile src/Makefile src/filter/Makefile \ 103 102 src/backend/Makefile src/frontend/Makefile src/contactmethod/Makefile]) 103 AC_OUTPUT todo2/trunk/doc
- Property svn:ignore set to
Makefile.in
- Property svn:ignore set to
todo2/trunk/src
- Property svn:ignore set to
Makefile.in
- Property svn:ignore set to
todo2/trunk/src/backend
- Property svn:ignore set to
Makefile.in
- Property svn:ignore set to
todo2/trunk/src/config.h.in
r295 r297 25 25 #undef HAVE_BCOPY 26 26 27 /* Define to 1 if you have the `closedir' function. */ 28 #undef HAVE_CLOSEDIR 29 27 30 /* Define to 1 if you have the <ctype.h> header file. */ 28 31 #undef HAVE_CTYPE_H … … 47 50 #undef HAVE_DL_H 48 51 52 /* Define if you have the _dyld_func_lookup function. */ 53 #undef HAVE_DYLD 54 49 55 /* Define to 1 if you have the <errno.h> header file. */ 50 56 #undef HAVE_ERRNO_H … … 61 67 /* Define if you have the libdl library or equivalent. */ 62 68 #undef HAVE_LIBDL 69 70 /* Define to 1 if you have the <mach-o/dyld.h> header file. */ 71 #undef HAVE_MACH_O_DYLD_H 63 72 64 73 /* Define to 1 if you have the <malloc.h> header file. */ … … 77 86 #undef HAVE_NDIR_H 78 87 88 /* Define to 1 if you have the `opendir' function. */ 89 #undef HAVE_OPENDIR 90 79 91 /* Define if libtool can extract symbol lists from object files. */ 80 92 #undef HAVE_PRELOADED_SYMBOLS 93 94 /* Define to 1 if you have the `readdir' function. */ 95 #undef HAVE_READDIR 81 96 82 97 /* Define to 1 if you have the `rindex' function. */ … … 177 192 #undef const 178 193 179 /* Define to a type to use for \`error_t' if it is not otherwise available. */194 /* Define to a type to use for `error_t' if it is not otherwise available. */ 180 195 #undef error_t todo2/trunk/src/contactmethod
- Property svn:ignore set to
Makefile.in
- Property svn:ignore set to
todo2/trunk/src/filter
- Property svn:ignore set to
Makefile.in
- Property svn:ignore set to
todo2/trunk/src/filter/Expression.cc
r295 r297 1 1 #include <crash/Regex.h> 2 2 #include <crash/StringManip.h> 3 #include <crash/Crash.h> 3 4 #include "Manager.h" 4 5 #include "Expression.h" … … 98 99 " true boolean true\n" 99 100 " false boolean false\n" 101 " active is item active\n" 102 " created item creation time\n" 103 " modified item modification time\n" 104 " owner item owner\n" 105 " type item type\n" 106 " now current time\n" 107 " lifetime item lifetime\n" 108 " username current system username\n" 109 " hostname system hostname\n" 100 110 "\n" 101 111 "If a key is not present in the current node, it will be searched for under\n" … … 254 264 if (ev == "owner") return item->owner()->id(); 255 265 if (ev == "type") return (double)item->type(); 256 if (ev == "now") return (double)time(0);266 if (ev == "now") return crash::time(); 257 267 if (ev == "lifetime") return (double)item->lifetime(); 268 if (ev == "username") return crash::username(); 269 if (ev == "hostname") return crash::hostname(); 258 270 259 271 if (manager.havePriority(ev)) return (double)manager.priority(ev); todo2/trunk/src/frontend
- Property svn:ignore set to
Makefile.in
- Property svn:ignore set to
todo2/trunk/src/main.cc
r295 r297 91 91 } 92 92 93 /* Load configuration files */ 93 94 manager.load(SYSCONFDIR "/todo2rc"); 94 95 if (getenv("HOME")) … … 99 100 for (Args::iterator i = args.begin(argc, argv); i != args.end(); ++i) 100 101 switch (i.option()) { 101 / /Debug is done twice, in case todo.debug is overridden in a102 // configuration file.102 /* Debug is done twice, in case todo.debug is overridden in a 103 configuration file. */ 103 104 case 'D' : 104 105 try { todo2/trunk/src/main.h
r295 r297 4 4 #include <string> 5 5 #include <cstdlib> 6 #include "gettext.h"7 6 #include "config.h" 8 7 todo2/trunk/src/Makefile.am
r295 r297 7 7 bin_PROGRAMS=todo2 8 8 todo2_SOURCES=\ 9 Scope.cc Scope.h \10 9 Manager.cc Manager.h \ 11 10 BackEnd.cc BackEnd.h \ … … 21 20 User.cc User.h \ 22 21 main.cc main.h \ 23 gettext.h \24 22 config.h 25 23 todo2/trunk/src/Manager.cc
r295 r297 61 61 set("frontends", "console"); 62 62 63 set("expression.filter", "! done");63 set("expression.filter", "!completed"); 64 64 set("priority.-2", "verylow"); 65 65 set("priority.-1", "low"); todo2/trunk/src/PropertyMap.cc
r295 r297 34 34 } 35 35 36 PropertyMap PropertyMap::prefixToPropertyMap(std::string prefix) const{37 PropertyMap props ;36 PropertyMap PropertyMap::prefixToPropertyMap(std::string prefix) { 37 PropertyMap props(this); 38 38 39 39 for (KeyValues::const_iterator i = mkv.begin(); i != mkv.end(); ++i) … … 45 45 void PropertyMap::load(std::string file) { 46 46 ifstream in(file.c_str()); 47 string line ;47 string line, section; 48 48 49 49 while (getline(in, line)) { … … 51 51 line = line.substr(0, line.find('#')); 52 52 53 if (line[0] == '[' && line.find(']')) { 54 section = line.substr(1, line.find(']') - 1) + "."; 55 while (section.find(":") != string::npos) section[section.find(":")] = '.'; 56 continue; 57 } 58 53 59 if (line.find('=') != string::npos) { 54 const string key = trim(line.substr(0, line.find('=')));60 const string key = section + trim(line.substr(0, line.find('='))); 55 61 56 62 set(key, ltrim(line.substr(line.find('=') + 1))); todo2/trunk/src/PropertyMap.h
r295 r297 33 33 }; 34 34 35 typedef std::map<std::string, Value> KeyValues; 36 typedef KeyValues::const_iterator const_iterator; 37 typedef KeyValues::iterator iterator; 38 35 39 typedef std::vector<std::string> Keys; 36 40 37 explicit PropertyMap(PropertyMap *parent = 0) : mparent (parent) {}41 explicit PropertyMap(PropertyMap *parent = 0) : mparentpm(parent) {} 38 42 39 PropertyMap *parent() { return mparent; } 40 const PropertyMap *parent() const { return mparent; } 43 PropertyMap *parent() { return mparentpm; } 44 const PropertyMap *parent() const { return mparentpm; } 45 PropertyMap *parent(PropertyMap *parent) { mparentpm = parent; return parent; } 41 46 42 47 Keys keys() const; … … 146 151 contact = mail:alec@swapoff.org 147 152 */ 148 PropertyMap prefixToPropertyMap(std::string prefix) const;153 PropertyMap prefixToPropertyMap(std::string prefix); 149 154 150 155 /// Load a property map from a configuration file … … 161 166 162 167 protected : 163 typedef std::map<std::string, Value> KeyValues;164 168 165 PropertyMap *mparent ;169 PropertyMap *mparentpm; 166 170 KeyValues mkv; 167 171 }; todo2/trunk/src/User.cc
r295 r297 7 7 using namespace crash; 8 8 9 User::User(const Scope::Map &prop) { 10 Scope::Map::const_iterator id = prop.find("id"), name = prop.find("name"), 11 contact = prop.find("contact"); 12 13 mid = id->second; 9 User::User(const PropertyMap &prop) { 10 mid = prop.get("id"); 14 11 mname = prop.get("name", mid); 15 12 mcontact = prop.get("contact", "mail:" + mid); todo2/trunk/src/User.h
r295 r297 5 5 #include <string> 6 6 #include <crash/Exception.h> 7 #include " Scope.h"7 #include "PropertyMap.h" 8 8 9 9 /** … … 18 18 19 19 User() {} 20 User(const Scope::Map &prop);20 User(const PropertyMap &prop); 21 21 22 22 std::string id() const { return mid; } todo2/trunk/.todo
r295 r297 1 <!-- Automagically generated by the ToDo program on 21/06/04, 22:20-->1 <!-- Automagically generated by the ToDo program on 15/11/04, 16:51 --> 2 2 <todo version="0.1.18"> 3 3 <title> … … 135 135 The Console frontend should have the ability to launch an external editor. 136 136 </note> 137 <note priority="low" time="1100497915"> 138 GANTT support. 139 </note> 137 140 </note> 138 141 </todo> todo2/trunk/.todo2
r295 r297 5 5 <id>kballico</id> 6 6 <name>Kristy Ballico</name> 7 <contact>mail kballico@failover.org</contact>7 <contact>mail:kballico@failover.org</contact> 8 8 </user> 9 9 … … 24 24 <start time="123123123"/> 25 25 <end time="123123123"/> 26 <owner id=" athomas"/>26 <owner id="kballico"/> 27 27 <title>This is the title</title> 28 28 <body>This is some cool text</body>
