From d4df7f095cfb07d55a1d7921fc88400924f96c85 Mon Sep 17 00:00:00 2001 From: kelson42 Date: Mon, 23 Apr 2012 21:17:05 +0000 Subject: [PATCH] + fix new CTPP2TextLoader class --- src/ctpp2/include/CTPP2TextLoader.hpp | 6 ++---- src/ctpp2/src/CTPP2TextLoader.cpp | 8 ++++---- 2 files changed, 6 insertions(+), 8 deletions(-) diff --git a/src/ctpp2/include/CTPP2TextLoader.hpp b/src/ctpp2/include/CTPP2TextLoader.hpp index 5e6a6e3..d280cb0 100644 --- a/src/ctpp2/include/CTPP2TextLoader.hpp +++ b/src/ctpp2/include/CTPP2TextLoader.hpp @@ -81,11 +81,9 @@ public: @brief A destructor */ ~CTPP2TextLoader() throw(); + private: - /** Template body */ - CHAR_P sTemplate; - /** Template size */ - UINT_32 iTemplateSize; + std::string templateText; }; } // namespace CTPP diff --git a/src/ctpp2/src/CTPP2TextLoader.cpp b/src/ctpp2/src/CTPP2TextLoader.cpp index 4244d5d..8f458b8 100644 --- a/src/ctpp2/src/CTPP2TextLoader.cpp +++ b/src/ctpp2/src/CTPP2TextLoader.cpp @@ -58,8 +58,7 @@ CTPP2SourceLoader * CTPP2TextLoader::Clone() // // Constructor // -CTPP2TextLoader::CTPP2TextLoader(): sTemplate(NULL), iTemplateSize(0) -{ +CTPP2TextLoader::CTPP2TextLoader() { } // @@ -67,6 +66,7 @@ CTPP2TextLoader::CTPP2TextLoader(): sTemplate(NULL), iTemplateSize(0) // INT_32 CTPP2TextLoader::LoadTemplate(CCHAR_P szTemplateName) { + this->templateText = std::string(szTemplateName); return 0; } @@ -75,8 +75,8 @@ INT_32 CTPP2TextLoader::LoadTemplate(CCHAR_P szTemplateName) // CCHAR_P CTPP2TextLoader::GetTemplate(UINT_32 & iITemplateSize) { - iITemplateSize = this->iTemplateSize; - return sTemplate; + iITemplateSize = this->templateText.size(); + return this->templateText.data(); } //