本文整理汇总了C++中php::Parameters::size方法的典型用法代码示例。如果您正苦于以下问题:C++ Parameters::size方法的具体用法?C++ Parameters::size怎么用?C++ Parameters::size使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类php::Parameters
的用法示例。
在下文中一共展示了Parameters::size方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: addColumn
void CRowPhpBridge::addColumn(Php::Parameters ¶ms)
{
if(2 == params.size()) {
if(params.at(0).isString()) {
m_row.addColumn(
params.at(0).stringValue(),
CVariantPhpBridge(params.at(1)));
} else {
SYNOPSIS_ERR_LOG("Invalid type of parameter[0]:%d\n", params.at(0).type());
}
} else {
SYNOPSIS_ERR_LOG("Invalid number of parameters:%zu\n", params.size());
}
}
示例2: setKeyColumnName
void CRowPhpBridge::setKeyColumnName(Php::Parameters ¶ms)
{
if(1 == params.size()) {
if(params.at(0).isString()) {
SYNOPSIS_DBG_ERR_LOG("[%s] params.at(0):%s\n",
__PRETTY_FUNCTION__, params.at(0).stringValue().c_str());
std::string sKeyColumnName = params.at(0).stringValue();
m_row.SetKeyColumnName(sKeyColumnName);
} else {
SYNOPSIS_ERR_LOG("Invalid type of parameter[0]:%d\n", params.at(0).type());
}
} else {
SYNOPSIS_ERR_LOG("Invalid number of parameters:%zu\n", params.size());
}
}
示例3: assign
/**
* Assign a variable to the javascript context
*
* @param params array of parameters:
* - string name of property to assign required
* - mixed property value to assign required
* - integer property attributes optional
*
* The property attributes can be one of the following values
*
* - ReadOnly
* - DontEnum
* - DontDelete
*
* If not specified, the property will be writable, enumerable and
* deletable.
*/
void Context::assign(Php::Parameters ¶ms)
{
// create a local "scope" and "enter" our context
v8::HandleScope scope(isolate());
v8::Context::Scope contextScope(_context);
// retrieve the global object from the context
v8::Local<v8::Object> global(_context->Global());
// the attribute for the newly assigned property
v8::PropertyAttribute attribute(v8::None);
// if an attribute was given, assign it
if (params.size() > 2)
{
// check the attribute that was selected
switch ((int16_t)params[2])
{
case v8::None: attribute = v8::None; break;
case v8::ReadOnly: attribute = v8::ReadOnly; break;
case v8::DontDelete: attribute = v8::DontDelete; break;
case v8::DontEnum: attribute = v8::DontEnum; break;
}
}
// and store the value
global->ForceSet(value(params[0]), value(params[1]), attribute);
}
示例4: my_with_undefined_parameters_function
/**
* my_with_undefined_parameters_function()
* @param Php:Parameters the given parameters
*/
void my_with_undefined_parameters_function(Php::Parameters ¶ms)
{
for (unsigned int i = 0; i < params.size(); i++)
{
cout << "Parameter " << i << ": " << params[i] << endl;
}
}
示例5: resize
Php::Value FastImage::resize(Php::Parameters ¶meters)
{
Php::Value self(this);
int width = parameters[0];
int height = parameters[1];
bool save_ascpect_ratio = true;
if (parameters.size() == 3) {
save_ascpect_ratio = parameters[2];
}
if (save_ascpect_ratio) {
std::vector<int> calculated_size = calculateResizedImageSize(width, height);
width = calculated_size[0];
height = calculated_size[1];
}
cv::Mat resizedImage;
if (width > 0 && height > 0) {
cv::Size new_size;
new_size.width = width;
new_size.height = height;
cv::resize(cvImage, resizedImage, new_size);
} else {
throwToSmallException("FastImage::resize");
}
cvImage = resizedImage;
resizedImage.release();
return self;
}
示例6: my_with_defined_object_parameters_function
/**
* my_with_defined_object_parameters_function()
* The use of objects is not yet implemented.
* @param Php::Parameters the given parameters
*/
void my_with_defined_object_parameters_function(Php::Parameters ¶ms)
{
for (unsigned int i = 0; i < params.size(); i++)
{
cout << params[i] << endl;
}
}
示例7: new_with_buttons
Php::Value GtkDialog_::new_with_buttons(Php::Parameters ¶meters)
{
std::string s_title = parameters[0];
gchar *title = (gchar *)s_title.c_str();
GtkWindow *parent;
if(parameters.size() > 1) {
Php::Value object_parent = parameters[1];
GtkWindow_ *phpgtk_parent = (GtkWindow_ *)object_parent.implementation();
parent = GTK_WINDOW(phpgtk_parent->get_instance());
}
int int_flags = (int)parameters[2];
GtkDialogFlags flags = (GtkDialogFlags)int_flags;
// std::string s_first_button_text = parameters[3];
// gchar *first_button_text = (gchar *)s_first_button_text.c_str();
// Create object
GtkDialog_ *dialog = new GtkDialog_();
// dialog->__construct();
// gtk_window_set_title(GTK_WINDOW(dialog->instance), title);
// gtk_widget_set_parent(GTK_WIDGET(dialog->instance), GTK_WIDGET(parent));
// gtk_dialog_add_button(GTK_DIALOG(dialog->instance), "OK", GTK_RESPONSE_OK);
// gtk_dialog_add_button(GTK_DIALOG(dialog->instance), "Cancel", GTK_RESPONSE_CANCEL);
dialog->set_instance((gpointer *)gtk_dialog_new_with_buttons(title, GTK_WINDOW(parent), flags, "OK", GTK_RESPONSE_OK, "Cancel", GTK_RESPONSE_CANCEL, NULL));
return Php::Object("GtkDialog", dialog);
}
示例8: getColumnValue
Php::Value CRowPhpBridge::getColumnValue(Php::Parameters ¶ms)
{
if(1 == params.size()) {
if(params.at(0).isString()) {
SYNOPSIS_DBG_ERR_LOG("CRowPhpBridge::getColumnValue params.at(0):%s\n", params.at(0).stringValue().c_str());
std::string sKey = params.at(0).stringValue();
synopsis::CVariant varRes = m_row.getColumnValue(sKey);
Php::Value phpRes = CVariant2PhpValue(varRes);
return phpRes;
} else {
SYNOPSIS_ERR_LOG("Invalid type of parameter[0]:%d\n", params.at(0).type());
}
} else {
SYNOPSIS_ERR_LOG("Invalid number of parameters:%zu\n", params.size());
}
return Php::Value();
}
示例9: __construct
void __construct(Php::Parameters ¶ms) {
if (params.size() == 2) {
r = params[0];
i = params[1];
} else {
r = 0;
i = 0;
}
}
示例10: my_with_defined_parameters_function
/**
* my_with_defined_parameters_function()
* @param Php::Parameters the given parameters
* @return Php::Value Param[0] and Param[1] added
*/
Php::Value my_with_defined_parameters_function(Php::Parameters ¶ms)
{
for (unsigned int i = 0; i < params.size(); i++)
{
cout << "Parameter " << i << ": " << params[i] << endl;
}
return params[0] + params[1];
}
示例11: get
Php::Value DI::get(Php::Parameters ¶ms)
{
try {
Php::Value name = params.at(0);
Php::Value parameters = params.size() > 1 ? params.at(1) : Php::Value(nullptr);
} catch (const std::out_of_range& e) {
throw Php::Exception("Invalid number of parameters supplied");
}
return this;
}
示例12: remove
void GtkTextTagTable_::remove(Php::Parameters ¶meters)
{
GtkTextTag *tag;
if(parameters.size() > 0) {
Php::Value object_tag = parameters[0];
GtkTextTag_ *phpgtk_tag = (GtkTextTag_ *)object_tag.implementation();
tag = (phpgtk_tag->get_tag());
}
gtk_text_tag_table_remove (GTK_TEXT_TAG_TABLE(instance), tag);
}
示例13: set
Php::Value DI::set(Php::Parameters ¶ms)
{
try {
Php::Value name = params.at(0);
Php::Value definition = params.at(1);
Php::Value shared = params.size() > 2 ? params.at(2) : Php::Value(false);
} catch (const std::out_of_range& e) {
throw Php::Exception("Invalid number of parameters supplied");
}
return this;
}
示例14: set_submenu
void GtkMenuItem_::set_submenu(Php::Parameters ¶meters)
{
GtkWidget *submenu;
if(parameters.size() > 0) {
Php::Value object_submenu = parameters[0];
GtkWidget_ *phpgtk_submenu = (GtkWidget_ *)object_submenu.implementation();
submenu = GTK_WIDGET(phpgtk_submenu->get_instance());
}
gtk_menu_item_set_submenu (GTK_MENU_ITEM(instance), submenu);
}
示例15: set_mnemonic_widget
void GtkLabel_::set_mnemonic_widget(Php::Parameters ¶meters)
{
GtkWidget *widget;
if(parameters.size() > 0) {
Php::Value object_widget = parameters[0];
GtkWidget_ *phpgtk_widget = (GtkWidget_ *)object_widget.implementation();
widget = GTK_WIDGET(phpgtk_widget->get_instance());
}
gtk_label_set_mnemonic_widget (GTK_LABEL(instance), widget);
}