--- ./src/Resources.hh 2004-03-02 17:49:51.000000000 +0100 +++ /home/sean/tmp/dpep-work.kCLHyF/fbpager-0.1.4/src/Resources.hh 2006-05-29 22:05:44.000000000 +0200 @@ -8,8 +8,10 @@ #include #include +namespace FbTk { + template<> -void FbTk::Resource:: +void Resource:: setFromString(char const *strval) { if (strcasecmp(strval, "true") == 0 || strcasecmp(strval, "yes") == 0) @@ -19,38 +21,37 @@ } template<> -std::string FbTk::Resource:: +std::string Resource:: getString() { return std::string(**this == true ? "true" : "false"); } template <> -void FbTk::Resource::setFromString(const char *str) { +void Resource::setFromString(const char *str) { *(*this) = (str ? str : ""); } template <> -std::string FbTk::Resource::getString() { +std::string Resource::getString() { return *(*this); } template <> -void FbTk::Resource::setFromString(const char *str) { +void Resource::setFromString(const char *str) { if (str == 0) return; sscanf(str, "%d", &(*(*this))); } template <> -std::string FbTk::Resource::getString() { +std::string Resource::getString() { char buff[16]; sprintf(buff, "%d", (*(*this))); return std::string(buff); } -namespace FbPager { template <> -void FbTk::Resource::setFromString(const char *str) { +void Resource::setFromString(const char *str) { if (strcmp("TopToBottom", str) == 0) *(*this) = FbPager::FbPager::TOP_TO_BOTTOM; else @@ -58,7 +59,7 @@ } template <> -std::string FbTk::Resource::getString() { +std::string Resource::getString() { switch (*(*this)) { case FbPager::FbPager::LEFT_TO_RIGHT: return "LeftToRight"; @@ -67,6 +68,6 @@ } } -} // end namespace FbPager +} // end namespace FbTk #endif // RESOURCES