X-Git-Url: https://git.llucax.com/software/bife/bife%20%20.git/blobdiff_plain/3de3fcc595200e235aadf399c64160b0bd0da7cc..65bbdd707ba33de08101076a7191585d6f44c507:/chit.h/software/bife/bife++.git/blobdiff_plain/3de3fcc595200e235aadf399c64160b0bd0da7cc..65bbdd707ba33de08101076a7191585d6f44c507:/chit.h?ds=sidebyside diff --git a/chit.h b/chit.h index a246288..4043d29 100644 --- a/chit.h +++ b/chit.h @@ -1,49 +1,59 @@ // vim: set expandtab tabstop=4 shiftwidth=4: -#ifndef _BIFE_CHIT_H_ -#define _BIFE_CHIT_H_ +#ifndef BIFE_CHIT_H +#define BIFE_CHIT_H -#include -#include "hash.h" #include "ghit.h" +#include "hash.h" +#include + +namespace bife { + + using std::string; + + /** + * Cache enabled GHIT. + * + * GHIT with cache capabilities added. The templates are stored in memory once + * they are readed and reused in succesive parse() calls, avoiding disc reads + * overhead. + * + * @todo See if it's really usefull, since the OS is supposed to be in charge + * of disc cache. + */ + class CHIT: public GHIT { + // Attributes. + protected: + /// Cache storage. + Hash cache; + + // Methods. + protected: + /** + * Gets cached file content. + * + * @param filename Name of the file to get the content. + * @return File content. + */ + virtual string getFileContent(const string&); + + public: + /** + * Constructor. + * + * @param root Root directory from where to get the templates. + * @param postfix Postfix of the template files. + * @param group Starting group. + */ + CHIT(const string& = string("."), const string& = string(".tpl"), + const string& = string("")); + + /** + * Destructor. + */ + virtual ~CHIT(void); + }; -using namespace std; - -/** - * Cache enabled GHIT. - * - * GHIT with cache capabilities added. The templates are stored in memory once - * they are readed and reused in succesive parse() calls, avoiding disc reads - * overhead. - * - * @todo See if it's really usefull, since the OS is supposed to be in charge - * of disc cache. - */ -class CHIT: public GHIT { - // Attributes. - protected: - /// Cache storage. - Hash cache; - - // Methods. - protected: - /** - * Gets cached file content. - * - * @param filename Name of the file to get the content. - * @return File content. - */ - virtual string getFileContent(string); - - public: - /** - * Constructor. - * - * @param root Root directory from where to get the templates. - * @param postfix Postfix of the template files. - * @param group Starting group. - */ - CHIT(string = ".", string = ".tpl", string = ""); -}; +} #endif