X-Git-Url: https://git.llucax.com/software/bife/bife%20%20.git/blobdiff_plain/3de3fcc595200e235aadf399c64160b0bd0da7cc..62eb4c434ac30aa83ef05be78130cb42105f618c:/main.cpp/software/bife/bife++.git/blobdiff_plain/3de3fcc595200e235aadf399c64160b0bd0da7cc..62eb4c434ac30aa83ef05be78130cb42105f618c:/main.cpp diff --git a/main.cpp b/main.cpp index 5a4351d..80de24d 100644 --- a/main.cpp +++ b/main.cpp @@ -6,6 +6,10 @@ #include "hit.h" #include "ghit.h" #include "chit.h" +#include "string.h" + +using namespace std; +using namespace bife; int main(void) { const string indent = " "; @@ -22,7 +26,7 @@ int main(void) { cout << "=============" << endl; vars["NOMBRE"] = "Pedro"; vars["EDAD"] = "26"; - GHIT g; + GHIT g("./././"); cout << "We are using the default group: '" << g.getGroup() << "'." << endl; cout << indent << g.parse("test", vars) << endl; g.pushGroup("tpldir"); @@ -35,7 +39,7 @@ int main(void) { cout << "CHIT example:" << endl; cout << "=============" << endl; - CHIT c; + CHIT chit("././././././", ".tpl.html"); const int n = 65; for (int i = n; i < (n+10); i++) { stringstream ssi, ssc; @@ -43,6 +47,18 @@ int main(void) { ssc << char(i); vars["NOMBRE"] = "Chit gay " + ssc.str(); vars["EDAD"] = ssi.str(); - cout << indent << c.parse("test", vars) << endl; + cout << indent << chit.parse("test", vars) << endl; } + + cout << "bife::String example:" << endl; + cout << "=====================" << endl; + string s = "std::string"; + String a("Un string"); + String b = "Otro string"; + //String c = s; + cout << "s: '" << s << "' - " + << "a: '" << a << "' - " + << "b: '" << b << endl; + cout << "a.render(): '" << a.render(chit) << "' - " + << "b.render(): '" << b.render(chit) << endl; }