Introduce CefString and cef_string_t implementations that support string type conversions and customization of the API string type (issue #146).

git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@145 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
This commit is contained in:
Marshall Greenblatt
2010-11-22 17:49:46 +00:00
parent 1e1c2ad8d7
commit 7d60642638
121 changed files with 2598 additions and 3209 deletions

View File

@ -34,12 +34,12 @@ void CefPostDataElementCToCpp::SetToEmpty()
return struct_->set_to_empty(struct_);
}
void CefPostDataElementCToCpp::SetToFile(const std::wstring& fileName)
void CefPostDataElementCToCpp::SetToFile(const CefString& fileName)
{
if(CEF_MEMBER_MISSING(struct_, set_to_file))
return;
return struct_->set_to_file(struct_, fileName.c_str());
return struct_->set_to_file(struct_, fileName.GetStruct());
}
void CefPostDataElementCToCpp::SetToBytes(size_t size, const void* bytes)
@ -58,18 +58,14 @@ CefPostDataElement::Type CefPostDataElementCToCpp::GetType()
return struct_->get_type(struct_);
}
std::wstring CefPostDataElementCToCpp::GetFile()
CefString CefPostDataElementCToCpp::GetFile()
{
std::wstring str;
CefString str;
if(CEF_MEMBER_MISSING(struct_, get_file))
return str;
cef_string_t cef_str = struct_->get_file(struct_);
if(cef_str) {
str = cef_str;
cef_string_free(cef_str);
}
cef_string_userfree_t strPtr = struct_->get_file(struct_);
str.AttachToUserFree(strPtr);
return str;
}