summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rwxr-xr-xsrc/XmlHandler/XmlHandler.cpp19
-rwxr-xr-xsrc/XmlHandler/XmlHandler.h4
2 files changed, 11 insertions, 12 deletions
diff --git a/src/XmlHandler/XmlHandler.cpp b/src/XmlHandler/XmlHandler.cpp
index 75964f0..d36ec2e 100755
--- a/src/XmlHandler/XmlHandler.cpp
+++ b/src/XmlHandler/XmlHandler.cpp
@@ -153,14 +153,11 @@ XmlHandler::EndElement(void *ctx, const xmlChar *name)
XmlHandler *pHandler = null;
pHandler = (XmlHandler *)ctx;
bool xmlResult = false;
- String* pCharacters = pHandler->GetCharacters();
+ char* pCharacters = pHandler->GetCharacters();
- if (pCharacters && (pCharacters->IsEmpty() == false))
+ if (pCharacters && (strlen(pCharacters) > 0))
{
- std::unique_ptr<char[]> pCharacter(_StringConverter::CopyToCharArrayN(*pCharacters));
- TryReturnVoid(pCharacter, "pCharacter is null.");
-
- xmlResult = pHandler->OnCharacters(pCharacter.get());
+ xmlResult = pHandler->OnCharacters(pCharacters);
if (xmlResult == false)
{
pHandler->SetError();
@@ -406,16 +403,18 @@ XmlHandler::SetCharacters(const char* pCharacter)
if (__pCharacters == null)
{
- __pCharacters = new (std::nothrow) String(4096);
+ __pCharacters = new (std::nothrow) char[4096];
TryReturn(__pCharacters, false, "[osp-installer] __pCharacters is null");
+
+ memset(__pCharacters, 0, 4096);
}
- __pCharacters->Append(pCharacter);
+ strncat(__pCharacters, pCharacter, strlen(pCharacter));
return true;
}
-String*
+char*
XmlHandler::GetCharacters(void)
{
return __pCharacters;
@@ -424,7 +423,7 @@ XmlHandler::GetCharacters(void)
void
XmlHandler::DeleteCharacters(void)
{
- delete __pCharacters;
+ delete[] __pCharacters;
__pCharacters = null;
}
diff --git a/src/XmlHandler/XmlHandler.h b/src/XmlHandler/XmlHandler.h
index 7c25b83..8d3c6bd 100755
--- a/src/XmlHandler/XmlHandler.h
+++ b/src/XmlHandler/XmlHandler.h
@@ -78,7 +78,7 @@ protected:
void DeleteElement(void);
bool SetCharacters(const char* pCharacter);
- Tizen::Base::String* GetCharacters(void);
+ char* GetCharacters(void);
void DeleteCharacters(void);
void SetAttribute(XmlAttribute *pAttr);
@@ -96,7 +96,7 @@ private:
XmlAttribute* __pAttr;
char* __pElementName;
- Tizen::Base::String* __pCharacters;
+ char* __pCharacters;
Tizen::Base::Collection::Stack __elementStack;
bool __error;