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

@ -44,13 +44,13 @@ bool CefZipReaderCToCpp::MoveToNextFile()
return struct_->move_to_next_file(struct_) ? true : false;
}
bool CefZipReaderCToCpp::MoveToFile(const std::wstring& fileName,
bool CefZipReaderCToCpp::MoveToFile(const CefString& fileName,
bool caseSensitive)
{
if(CEF_MEMBER_MISSING(struct_, move_to_file))
return false;
return struct_->move_to_file(struct_, fileName.c_str(), caseSensitive) ?
return struct_->move_to_file(struct_, fileName.GetStruct(), caseSensitive) ?
true : false;
}
@ -62,18 +62,14 @@ bool CefZipReaderCToCpp::Close()
return struct_->close(struct_) ? true : false;
}
std::wstring CefZipReaderCToCpp::GetFileName()
CefString CefZipReaderCToCpp::GetFileName()
{
std::wstring str;
CefString str;
if(CEF_MEMBER_MISSING(struct_, get_file_name))
return str;
cef_string_t cef_str = struct_->get_file_name(struct_);
if(cef_str) {
str = cef_str;
cef_string_free(cef_str);
}
cef_string_userfree_t strPtr = struct_->get_file_name(struct_);
str.AttachToUserFree(strPtr);
return str;
}
@ -93,12 +89,12 @@ time_t CefZipReaderCToCpp::GetFileLastModified()
return struct_->get_file_last_modified(struct_);
}
bool CefZipReaderCToCpp::OpenFile(const std::wstring& password)
bool CefZipReaderCToCpp::OpenFile(const CefString& password)
{
if(CEF_MEMBER_MISSING(struct_, open_file))
return 0;
return struct_->open_file(struct_, password.c_str()) ? true : false;
return struct_->open_file(struct_, password.GetStruct()) ? true : false;
}
bool CefZipReaderCToCpp::CloseFile()