当前位置: 首页>>代码示例>>C++>>正文


C++ php::Parameters类代码示例

本文整理汇总了C++中php::Parameters的典型用法代码示例。如果您正苦于以下问题:C++ Parameters类的具体用法?C++ Parameters怎么用?C++ Parameters使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


在下文中一共展示了Parameters类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: get

	Php::Value DI::get(Php::Parameters &params)
	{
		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;
	}
开发者ID:xubingyue,项目名称:cpphalcon,代码行数:11,代码来源:DI.cpp

示例2: set

	Php::Value DI::set(Php::Parameters &params)
	{
		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;
	}
开发者ID:xubingyue,项目名称:cpphalcon,代码行数:12,代码来源:DI.cpp

示例3: pushBack

void CRowsPhpBridge::pushBack(Php::Parameters &params)
{
    if(params.size() > 0) {
        if(Php::Type::Object == params.at(0).type()) {
            if(params.at(0).implementation()){
                CRowPhpBridge *pRowPhpBridge = dynamic_cast<CRowPhpBridge*>(params.at(0).implementation());
                if(pRowPhpBridge) {
                    SYNOPSIS_DBG_ERR_LOG("CRowsPhpBridge::pushBack\n");
                    m_Rows.push_back(pRowPhpBridge->daoRow());
                }
            }
        }
    }
}
开发者ID:UnstoppableMomentum,项目名称:synopsis-php,代码行数:14,代码来源:crows_php_bridge.cpp

示例4: Open

Php::Value Database::Open(Php::Parameters &params)
{
	if(IsOpen())
	{
		m_last_error = ErrorMessages::AlreadyActiveConnection;
		return false;
	}

	bool create_if_missing = false;

	if(params.empty() || !params[0].isBool())
		create_if_missing = false;
	else
		create_if_missing = params[0].boolValue();

	rocksdb::Options options;
	options.create_if_missing = create_if_missing;

	rocksdb::Status status = rocksdb::DB::Open(options, m_db_path, &m_rdb);

	if(!status.ok())
	{
		m_last_error = status.ToString();
		m_is_open = false;
		return false;
	}

	m_is_open = true;

	return true;
}
开发者ID:Photonios,项目名称:rocksdb-php,代码行数:31,代码来源:database.cpp

示例5: 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 &params)
{
    // 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);
}
开发者ID:hanigamal,项目名称:PHP-JS,代码行数:45,代码来源:context.cpp

示例6: resize

Php::Value FastImage::resize(Php::Parameters &parameters)
{
	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;
}
开发者ID:gunesahmet,项目名称:PhpFastImage,代码行数:33,代码来源:fast_image_class.cpp

示例7: 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 &params)
{
    for (unsigned int i = 0; i < params.size(); i++)
    {
        cout << params[i] << endl;
    }
}
开发者ID:Alex-duzhichao,项目名称:PHP-CPP-LEGACY,代码行数:12,代码来源:functionwithparameters.cpp

示例8: new_with_buttons

Php::Value GtkDialog_::new_with_buttons(Php::Parameters &parameters)
{
	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);
}
开发者ID:scorninpc,项目名称:php-gtk3-tests,代码行数:32,代码来源:GtkDialog.cpp

示例9: __construct

void Database::__construct(Php::Parameters &params)
{
	if(params.empty() || !params[0].isString())
		Php::ThrowError(ErrorMessages::InvalidParamExpectedString);

	m_db_path = params[0].stringValue();
}
开发者ID:Photonios,项目名称:rocksdb-php,代码行数:7,代码来源:database.cpp

示例10: my_with_undefined_parameters_function

/**
 *  my_with_undefined_parameters_function()
 *  @param  Php:Parameters  the given parameters
 */
void my_with_undefined_parameters_function(Php::Parameters &params)
{
    for (unsigned int i = 0; i < params.size(); i++)
    {
        cout << "Parameter " << i << ": " << params[i] << endl;
    }
}
开发者ID:Alex-duzhichao,项目名称:PHP-CPP-LEGACY,代码行数:11,代码来源:functionwithparameters.cpp

示例11: Put

Php::Value Database::Put(Php::Parameters &params)
{
	if(params.empty() || params.size() < 2)
		Php::ThrowError(ErrorMessages::ExpectedTwoParamters);

	if(!IsOpen())
	{
		m_last_error = ErrorMessages::NoActiveConnection;
		return false;
	}

	std::string key = params[0].stringValue();
	std::string value = params[1].stringValue();

	m_rdb->Put(rocksdb::WriteOptions(), key, value);

	return true;
}
开发者ID:Photonios,项目名称:rocksdb-php,代码行数:18,代码来源:database.cpp

示例12: setDefault

	void DI::setDefault(Php::Parameters &params)
	{
		try {
			Php::Value value = params.at(0);
			_default = (DI *) value.implementation();
		} catch (const std::out_of_range& e) {
			throw Php::Exception("Invalid number of parameters supplied");
		}
	}
开发者ID:xubingyue,项目名称:cpphalcon,代码行数:9,代码来源:DI.cpp

示例13: 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 &params)
{
    for (unsigned int i = 0; i < params.size(); i++)
    {
        cout << "Parameter " << i << ": " << params[i] << endl;
    }
    
    return params[0] + params[1];
}
开发者ID:Alex-duzhichao,项目名称:PHP-CPP-LEGACY,代码行数:14,代码来源:functionwithparameters.cpp

示例14: __construct

 void __construct(Php::Parameters &params) {
     if (params.size() == 2) {
         r = params[0];
         i = params[1];
     } else {
         r = 0;
         i = 0;
     }
 }
开发者ID:georaphael,项目名称:complex,代码行数:9,代码来源:main.cpp

示例15: set_image

void GtkClipboard_::set_image(Php::Parameters &parameters)
{
	GdkPixbuf *pixbuf;
	if(parameters.size() > 0) {
		Php::Value object_pixbuf = parameters[0];
		GdkPixbuf_ *phpgtk_pixbuf = (GdkPixbuf_ *)object_pixbuf.implementation();
		pixbuf = phpgtk_pixbuf->get_instance();
	}

	gtk_clipboard_set_image (GTK_CLIPBOARD(instance), pixbuf);

}
开发者ID:scorninpc,项目名称:php-gtk3-tests,代码行数:12,代码来源:GtkClipboard.cpp


注:本文中的php::Parameters类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。