aboutsummaryrefslogtreecommitdiffstats
path: root/src/word.cpp
diff options
context:
space:
mode:
authorVincent Richard <[email protected]>2005-07-12 22:28:02 +0000
committerVincent Richard <[email protected]>2005-07-12 22:28:02 +0000
commit681297e10b666e13cc463f6fbb16236f36c3266c (patch)
tree5d2392e2283232ed3475cd9c69e22897b03e8a97 /src/word.cpp
parentAdded contentHandler::extractRaw(). (diff)
downloadvmime-681297e10b666e13cc463f6fbb16236f36c3266c.tar.gz
vmime-681297e10b666e13cc463f6fbb16236f36c3266c.zip
Reference counting and smart pointers.
Diffstat (limited to 'src/word.cpp')
-rw-r--r--src/word.cpp24
1 files changed, 12 insertions, 12 deletions
diff --git a/src/word.cpp b/src/word.cpp
index f55a66f3..cff5afe3 100644
--- a/src/word.cpp
+++ b/src/word.cpp
@@ -57,7 +57,7 @@ word::word(const string& buffer, const charset& charset)
}
-word* word::parseNext(const string& buffer, const string::size_type position,
+ref <word> word::parseNext(const string& buffer, const string::size_type position,
const string::size_type end, string::size_type* newPosition,
bool prevIsEncoded, bool* isEncoded, bool isFirst)
{
@@ -101,7 +101,7 @@ word* word::parseNext(const string& buffer, const string::size_type position,
if (!unencoded.empty())
{
- word* w = new word(unencoded, charset(charsets::US_ASCII));
+ ref <word> w = vmime::create <word>(unencoded, charset(charsets::US_ASCII));
w->setParsedBounds(position, pos);
if (newPosition)
@@ -158,7 +158,7 @@ word* word::parseNext(const string& buffer, const string::size_type position,
pos += 2; // ?=
- word* w = new word();
+ ref <word> w = vmime::create <word>();
w->parse(buffer, wordStart, pos, NULL);
if (newPosition)
@@ -181,7 +181,7 @@ word* word::parseNext(const string& buffer, const string::size_type position,
unencoded += string(buffer.begin() + startPos, buffer.begin() + end);
- word* w = new word(unencoded, charset(charsets::US_ASCII));
+ ref <word> w = vmime::create <word>(unencoded, charset(charsets::US_ASCII));
w->setParsedBounds(position, end);
if (newPosition)
@@ -193,15 +193,15 @@ word* word::parseNext(const string& buffer, const string::size_type position,
return (w);
}
- return (NULL);
+ return (null);
}
-const std::vector <word*> word::parseMultiple(const string& buffer, const string::size_type position,
+const std::vector <ref <word> > word::parseMultiple(const string& buffer, const string::size_type position,
const string::size_type end, string::size_type* newPosition)
{
- std::vector <word*> res;
- word* w = NULL;
+ std::vector <ref <word> > res;
+ ref <word> w;
string::size_type pos = position;
@@ -694,9 +694,9 @@ const string word::getConvertedText(const charset& dest) const
}
-word* word::clone() const
+ref <component> word::clone() const
{
- return new word(m_buffer, m_charset);
+ return vmime::create <word>(m_buffer, m_charset);
}
@@ -730,9 +730,9 @@ void word::setBuffer(const string& buffer)
}
-const std::vector <const component*> word::getChildComponents() const
+const std::vector <ref <const component> > word::getChildComponents() const
{
- return std::vector <const component*>();
+ return std::vector <ref <const component> >();
}