mirror of
https://bitbucket.org/chromiumembedded/cef
synced 2025-06-05 21:39:12 +02:00
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:
@@ -50,7 +50,7 @@ class ClientDownloadHandler : public CefThreadSafeBase<CefDownloadHandler>
|
||||
{
|
||||
public:
|
||||
ClientDownloadHandler(CefRefPtr<DownloadListener> listener,
|
||||
const std::wstring& fileName)
|
||||
const CefString& fileName)
|
||||
: listener_(listener), filename_(fileName), file_(NULL)
|
||||
{
|
||||
// Open the file on the FILE thread.
|
||||
@@ -140,8 +140,9 @@ public:
|
||||
// Save the file in the user's "My Documents" folder.
|
||||
if(SUCCEEDED(SHGetFolderPath(NULL, CSIDL_PERSONAL|CSIDL_FLAG_CREATE,
|
||||
NULL, 0, szFolderPath))) {
|
||||
LPWSTR name = PathFindFileName(filename_.c_str());
|
||||
LPWSTR ext = PathFindExtension(filename_.c_str());
|
||||
std::wstring fileNameStr = filename_;
|
||||
LPWSTR name = PathFindFileName(fileNameStr.c_str());
|
||||
LPWSTR ext = PathFindExtension(fileNameStr.c_str());
|
||||
int ct = 0;
|
||||
std::wstringstream ss;
|
||||
|
||||
@@ -222,13 +223,13 @@ public:
|
||||
|
||||
private:
|
||||
CefRefPtr<DownloadListener> listener_;
|
||||
std::wstring filename_;
|
||||
CefString filename_;
|
||||
FILE* file_;
|
||||
std::vector<std::vector<char>*> pending_data_;
|
||||
};
|
||||
|
||||
CefRefPtr<CefDownloadHandler> CreateDownloadHandler(
|
||||
CefRefPtr<DownloadListener> listener, const std::wstring& fileName)
|
||||
CefRefPtr<DownloadListener> listener, const CefString& fileName)
|
||||
{
|
||||
return new ClientDownloadHandler(listener, fileName);
|
||||
}
|
||||
|
Reference in New Issue
Block a user