+2006-11-20 Anders Carlsson <acarlsson@apple.com>
+
+ Reviewed by Maciej.
+
+ Use CString instead of DeprecatedCString.
+
+ * html/FormDataList.cpp:
+ (WebCore::FormDataList::appendString):
+ (WebCore::fixLineBreaks):
+ (WebCore::FormDataList::appendFile):
+
2006-11-20 Samuel Weinig <sam@webkit.org>
Reviewed by Alexey.
#include "config.h"
#include "FormDataList.h"
-#include "DeprecatedCString.h"
-
namespace WebCore {
FormDataList::FormDataList(const TextEncoding& c)
{
}
-void FormDataList::appendString(const CString &s)
+void FormDataList::appendString(const CString& s)
{
m_list.append(s);
}
// Change plain CR and plain LF to CRLF pairs.
-static DeprecatedCString fixLineBreaks(const DeprecatedCString &s)
+static CString fixLineBreaks(const CString &s)
{
// Compute the length.
unsigned newLen = 0;
// Make a copy of the string.
p = s.data();
- DeprecatedCString result(newLen + 1);
- char *q = result.data();
+ char *q;
+ CString result = CString::newUninitialized(newLen, q);
while (char c = *p++) {
if (c == '\r') {
// Safe to look ahead because of trailing '\0'.
void FormDataList::appendString(const String& s)
{
- DeprecatedCString cstr = fixLineBreaks(m_encoding.encode(s.characters(), s.length(), true).deprecatedCString());
- cstr.truncate(cstr.length());
- m_list.append(CString(cstr));
+ CString cstr = fixLineBreaks(m_encoding.encode(s.characters(), s.length(), true));
+ m_list.append(cstr);
}
-void FormDataList::appendFile(const String &key, const String &filename)
+void FormDataList::appendFile(const String& key, const String& filename)
{
appendString(key);
m_list.append(filename);