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


C++ KValueRef::SetNull方法代码示例

本文整理汇总了C++中KValueRef::SetNull方法的典型用法代码示例。如果您正苦于以下问题:C++ KValueRef::SetNull方法的具体用法?C++ KValueRef::SetNull怎么用?C++ KValueRef::SetNull使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在KValueRef的用法示例。


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

示例1: _GetRuntime

	void ApplicationBinding::_GetRuntime(const ValueList& args, KValueRef result)
	{
		if (!this->application->runtime.isNull())
		{
			result->SetObject(new ComponentBinding(this->application->runtime));
		}
		else
		{
			result->SetNull();
		}
	}
开发者ID:OnlyChristopher,项目名称:TideSDK,代码行数:11,代码来源:application_binding.cpp

示例2: _GetSubmenu

	void MenuItem::_GetSubmenu(const ValueList& args, KValueRef result)
	{
		if (this->submenu.isNull())
		{
			result->SetNull();
		}
		else
		{
			result->SetObject(this->submenu);
		}
	}
开发者ID:JamesHayton,项目名称:titanium_desktop,代码行数:11,代码来源:menu_item.cpp

示例3: _GetMenu

	void UIBinding::_GetMenu(const ValueList& args, KValueRef result)
	{
		AutoMenu menu = this->GetMenu();
		if (menu.isNull())
		{
			result->SetNull();
		}
		else
		{
			result->SetObject(menu);
		}
	}
开发者ID:ksmythe,项目名称:titanium_desktop,代码行数:12,代码来源:ui_binding.cpp

示例4: Field

 void ResultSetBinding::Field(const ValueList& args, KValueRef result)
 {
     if (rs.isNull())
     {
         result->SetNull();
     }
     else
     {
         args.VerifyException("field", "i");
         TransformValue(args.at(0)->ToInt(),result);
     }
 }
开发者ID:Adimpression,项目名称:TideSDK,代码行数:12,代码来源:resultset_binding.cpp

示例5: _ToLowerCase

	void Bytes::_ToLowerCase(const ValueList& args, KValueRef result)
	{
		if (this->size > 0)
		{
			std::string target(this->buffer, this->size);
			std::string r = Poco::toLower(target);
			result->SetString(r);
		}
		else
		{
			result->SetNull();
		}
	}
开发者ID:OnlyChristopher,项目名称:TideSDK,代码行数:13,代码来源:bytes.cpp

示例6: FieldName

 void ResultSetBinding::FieldName(const ValueList& args, KValueRef result)
 {
     if (rs.isNull())
     {
         result->SetNull();
     }
     else
     {
         args.VerifyException("fieldName", "i");
         const std::string &str = rs->columnName(args.at(0)->ToInt());
         result->SetString(str.c_str());
     }
 }
开发者ID:Adimpression,项目名称:TideSDK,代码行数:13,代码来源:resultset_binding.cpp

示例7: GetHeader

 void HttpServerRequest::GetHeader(const ValueList& args, KValueRef result)
 {
     args.VerifyException("getHeader", "s");
     std::string name = args.at(0)->ToString();
     if (request.has(name))
     {
         std::string value = request.get(name);
         result->SetString(value);
     }
     else
     {
         result->SetNull();
     }
 }
开发者ID:Adimpression,项目名称:TideSDK,代码行数:14,代码来源:http_server_request.cpp

示例8: GetResponseHeader

	void HTTPClientBinding::GetResponseHeader(const ValueList& args, KValueRef result)
	{
		args.VerifyException("getResponseHeader", "s");
		std::string name = args.GetString(0);

		if (this->response.has(name))
		{
			result->SetString(this->response.get(name).c_str());
		}
		else
		{
			result->SetNull();
		}
	}
开发者ID:mital,项目名称:titanium_desktop,代码行数:14,代码来源:http_client_binding.cpp

示例9: TransformValue

 void ResultSetBinding::TransformValue(size_t index, KValueRef result)
 {
     MetaColumn::ColumnDataType type = rs->columnType(index);
     Poco::DynamicAny value = rs->value(index);
     
     if (value.isEmpty())
     {
         result->SetNull();
     }
     else if (type == MetaColumn::FDT_STRING)
     {
         std::string str;
         value.convert(str);
         result->SetString(str);
     }
     else if (type == MetaColumn::FDT_BOOL)
     {
         bool v = false;
         value.convert(v);
         result->SetBool(v);
     }
     else if (type == MetaColumn::FDT_FLOAT || type == MetaColumn::FDT_DOUBLE)
     {
         float f = 0;
         value.convert(f);
         result->SetDouble(f);
     }
     else if (type == MetaColumn::FDT_BLOB || type == MetaColumn::FDT_UNKNOWN)
     {
         std::string str;
         value.convert(str);
         result->SetString(str);
     }
     else
     {
         // the rest of these are ints:
         // FDT_INT8,
         // FDT_UINT8,
         // FDT_INT16,
         // FDT_UINT16,
         // FDT_INT32,
         // FDT_UINT32,
         // FDT_INT64,
         // FDT_UINT64,
         int i;
         value.convert(i);
         result->SetInt(i);
     }
 }
开发者ID:Adimpression,项目名称:TideSDK,代码行数:49,代码来源:resultset_binding.cpp

示例10: _ReadApplicationManifest

    void APIBinding::_ReadApplicationManifest(const ValueList& args, KValueRef result)
    {
        args.VerifyException("readApplicationManifest", "s,?s");
        string manifestPath = args.at(0)->ToString();
        string appPath = args.GetString(1, FileUtils::Dirname(manifestPath));

        SharedApplication app = Application::NewApplication(manifestPath, appPath);
        if (!app.isNull())
        {
            result->SetObject(new ApplicationBinding(app));
        }
        else
        {
            result->SetNull();
        }
    }
开发者ID:fossamikom,项目名称:TideSDK,代码行数:16,代码来源:api_binding.cpp

示例11: GetCookie

	void HTTPClientBinding::GetCookie(const ValueList& args, KValueRef result)
	{
		args.VerifyException("getCookie", "s");
		std::string cookieName = args.GetString(0);

		if (this->responseCookies.find(cookieName) != this->responseCookies.end())
		{
			KObjectRef cookie = new HTTPCookie(this->responseCookies[cookieName]);
			result->SetObject(cookie);
		}
		else
		{
			// No cookie found with that name.
			result->SetNull();
		}
	}
开发者ID:mital,项目名称:titanium_desktop,代码行数:16,代码来源:http_client_binding.cpp

示例12: FieldByName

 void ResultSetBinding::FieldByName(const ValueList& args, KValueRef result)
 {
     result->SetNull();
     if (!rs.isNull())
     {
         args.VerifyException("fieldByName", "s");
         std::string name = args.at(0)->ToString();
         size_t count = rs->columnCount();
         for (size_t i = 0; i<count; i++)
         {
             const std::string &str = rs->columnName(i);
             if (str == name)
             {
                 TransformValue(i,result);
                 break;
             }
         }
     }
 }
开发者ID:Adimpression,项目名称:TideSDK,代码行数:19,代码来源:resultset_binding.cpp


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