"Fossies" - the Fresh Open Source Software Archive

Member "devtodo-0.1.20/src/Loaders.h" (9 May 2006, 960 Bytes) of package /linux/privat/old/devtodo-0.1.20.tar.gz:


As a special service "Fossies" has tried to format the requested source page into HTML format using (guessed) C and C++ source code syntax highlighting (style: standard) with prefixed line numbers and code folding option. Alternatively you can here view or download the uninterpreted source code file. For more information about "Loaders.h" see the Fossies "Dox" file reference documentation.

    1 #ifndef LOADERS_H__
    2 #define LOADERS_H__
    3 
    4 #include <stdexcept>
    5 #include <string>
    6 #include <map>
    7 #include <set>
    8 #include <fstream>
    9 #include "TodoDB.h"
   10 
   11 using namespace std;
   12 
   13 /*
   14     21/04/01    Initial creation
   15 */
   16 
   17 /*
   18     These functions load and save the database in a variety of user-selectable
   19     formats. The default is "xml", but "binary" is *much* faster.
   20 */
   21 
   22 struct load_error : public runtime_error { load_error(string const &what) : runtime_error(what.c_str()) {} };
   23 struct save_error : public runtime_error { save_error(string const &what) : runtime_error(what.c_str()) {} };
   24 
   25 typedef map<string, bool (*)(TodoDB &, string const &)> Loader;
   26 typedef map<string, bool (*)(TodoDB const &, string const &)> Saver;
   27 
   28 Loader getLoaders();
   29 Saver getSavers();
   30 
   31 bool xmlLoad(TodoDB &out, string const &file);
   32 bool xmlSave(TodoDB const &in, string const &file);
   33 
   34 bool binaryLoad(TodoDB &out, string const &file);
   35 bool binarySave(TodoDB const &in, string const &file);
   36 #endif