- Add CefCommandLine::GetArgv method (issue #707).

git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@751 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
This commit is contained in:
Marshall Greenblatt
2012-09-04 15:12:50 +00:00
parent 30ecc8a4db
commit c15048d75f
7 changed files with 75 additions and 0 deletions

View File

@@ -128,6 +128,31 @@ void CEF_CALLBACK command_line_reset(struct _cef_command_line_t* self) {
CefCommandLineCppToC::Get(self)->Reset();
}
void CEF_CALLBACK command_line_get_argv(struct _cef_command_line_t* self,
cef_string_list_t argv) {
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
DCHECK(self);
if (!self)
return;
// Verify param: argv; type: string_vec_byref
DCHECK(argv);
if (!argv)
return;
// Translate param: argv; type: string_vec_byref
std::vector<CefString> argvList;
transfer_string_list_contents(argv, argvList);
// Execute
CefCommandLineCppToC::Get(self)->GetArgv(
argvList);
// Restore param: argv; type: string_vec_byref
cef_string_list_clear(argv);
transfer_string_list_contents(argvList, argv);
}
cef_string_userfree_t CEF_CALLBACK command_line_get_command_line_string(
struct _cef_command_line_t* self) {
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
@@ -361,6 +386,7 @@ CefCommandLineCppToC::CefCommandLineCppToC(CefCommandLine* cls)
struct_.struct_.init_from_argv = command_line_init_from_argv;
struct_.struct_.init_from_string = command_line_init_from_string;
struct_.struct_.reset = command_line_reset;
struct_.struct_.get_argv = command_line_get_argv;
struct_.struct_.get_command_line_string =
command_line_get_command_line_string;
struct_.struct_.get_program = command_line_get_program;

View File

@@ -136,6 +136,30 @@ void CefCommandLineCToCpp::Reset() {
struct_->reset(struct_);
}
void CefCommandLineCToCpp::GetArgv(std::vector<CefString>& argv) {
if (CEF_MEMBER_MISSING(struct_, get_argv))
return;
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
// Translate param: argv; type: string_vec_byref
cef_string_list_t argvList = cef_string_list_alloc();
DCHECK(argvList);
if (argvList)
transfer_string_list_contents(argv, argvList);
// Execute
struct_->get_argv(struct_,
argvList);
// Restore param:argv; type: string_vec_byref
if (argvList) {
argv.clear();
transfer_string_list_contents(argvList, argv);
cef_string_list_free(argvList);
}
}
CefString CefCommandLineCToCpp::GetCommandLineString() {
if (CEF_MEMBER_MISSING(struct_, get_command_line_string))
return CefString();

View File

@@ -18,6 +18,7 @@
#pragma message("Warning: "__FILE__" may be accessed wrapper-side only")
#else // USING_CEF_SHARED
#include <vector>
#include "include/cef_command_line.h"
#include "include/capi/cef_command_line_capi.h"
#include "libcef_dll/ctocpp/ctocpp.h"
@@ -40,6 +41,7 @@ class CefCommandLineCToCpp
virtual void InitFromArgv(int argc, const char* const* argv) OVERRIDE;
virtual void InitFromString(const CefString& command_line) OVERRIDE;
virtual void Reset() OVERRIDE;
virtual void GetArgv(std::vector<CefString>& argv) OVERRIDE;
virtual CefString GetCommandLineString() OVERRIDE;
virtual CefString GetProgram() OVERRIDE;
virtual void SetProgram(const CefString& program) OVERRIDE;