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


C++ SharedValue::SetString方法代码示例

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


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

示例1: CharAt

	void Blob::CharAt(const ValueList& args, SharedValue result)
	{
		// https://developer.mozilla.org/en/core_javascript_1.5_reference/global_objects/string/charat
		args.VerifyException("Blob.charAt", "n");
		int position = args.at(0)->ToInt();

		char buf[2] = {'\0', '\0'};
		if (position >= 0 && position < this->length)
		{
			buf[0] = this->buffer[position];
		}
		result->SetString(buf);
	}
开发者ID:jonnymind,项目名称:kroll,代码行数:13,代码来源:blob.cpp

示例2: GetHeader

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

示例3: FieldName

	void ResultSetBinding::FieldName(const ValueList& args, SharedValue 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:CJ580K,项目名称:titanium,代码行数:13,代码来源:resultset_binding.cpp

示例4: ToUpperCase

	void Blob::ToUpperCase(const ValueList& args, SharedValue result)
	{
		if (this->length > 0)
		{
			std::string target = this->buffer;
			std::string r = Poco::toUpper(target);
			result->SetString(r);
		}
		else
		{
			result->SetNull();
		}
	}
开发者ID:jonnymind,项目名称:kroll,代码行数:13,代码来源:blob.cpp

示例5: GetIcon

	void AppBinding::GetIcon(const ValueList& args, SharedValue result)
	{
		const SharedApplication app = this->host->GetApplication();
		if (app->image.empty())
		{
			result->SetNull();
		}
		else
		{
			std::string iconPath = app->image;
			result->SetString(iconPath);
		}
	}
开发者ID:alicciabraaten,项目名称:titanium,代码行数:13,代码来源:app_binding.cpp

示例6: GetStreamURL

	void AppBinding::GetStreamURL(const ValueList& args, SharedValue result)
	{
		SharedApplication app = this->host->GetApplication();
		std::string url(app->GetStreamURL("https"));

		for (size_t c = 0; c < args.size(); c++)
		{
			SharedValue arg = args.at(c);
			if (arg->IsString())
			{
				url.append("/");
				url.append(arg->ToString());
			}
		}
		result->SetString(url);
	}
开发者ID:jonnymind,项目名称:titanium_desktop,代码行数:16,代码来源:app_binding.cpp

示例7: GetResponseHeader

	void HTTPClientBinding::GetResponseHeader(const ValueList& args, SharedValue result)
	{
		if (this->response!=NULL)
		{
			std::string name = args.at(0)->ToString();
			if (this->response->has(name))
			{
				result->SetString(this->response->get(name).c_str());
			}
			else
			{
				result->SetNull();
			}
		}
		else
		{
			throw ValueException::FromString("no available response");
		}
	}
开发者ID:CJ580K,项目名称:titanium,代码行数:19,代码来源:http_client_binding.cpp

示例8: Read

	void Pipe::Read(const ValueList& args, SharedValue result)
	{
		if (closed)
		{
			throw ValueException::FromString("Pipe is already closed");
		}
		Poco::PipeInputStream *is = dynamic_cast<Poco::PipeInputStream*>(pipe);
		if (is==NULL)
		{
			throw ValueException::FromString("Stream is not readable");
		}
		char *buf = NULL;
		try
		{
			int size = 1024;
			// allow the size of the returned buffer to be 
			// set by the caller - defaults to 1024 if not specified
			if (args.size()>0 && args.at(0)->IsInt())
			{
				size = args.at(0)->ToInt();
			}
			buf = new char[size];
			is->read(buf,size);
			int count = is->gcount();
			if (count <=0)
			{
				result->SetNull();
			}
			else
			{
				buf[count] = '\0';
				result->SetString(buf);
			}
			delete [] buf;
		}
		catch (Poco::ReadFileException &e)
		{
			if (buf) delete[] buf;
			throw ValueException::FromString(e.what());
		}
	}
开发者ID:pjunior,项目名称:titanium,代码行数:41,代码来源:pipe.cpp

示例9: DecodeURIComponent

void NetworkBinding::DecodeURIComponent(const ValueList &args, SharedValue result)
{
    std::string src = args.at(0)->ToString();
    std::string sResult = kroll::FileUtils::DecodeURIComponent(src);
    result->SetString(sResult);
}
开发者ID:rlwesq,项目名称:titanium,代码行数:6,代码来源:network_binding.cpp

示例10: GetVersion

	void AppBinding::GetVersion(const ValueList& args, SharedValue result)
	{
		result->SetString(AppConfig::Instance()->GetVersion().c_str());
	}
开发者ID:peggielich,项目名称:titanium,代码行数:4,代码来源:app_binding.cpp

示例11: ToString

	void IPAddressBinding::ToString(const ValueList& args, SharedValue result)
	{
		result->SetString(this->address->toString().c_str());
	}
开发者ID:peggielich,项目名称:titanium,代码行数:4,代码来源:ipaddress_binding.cpp

示例12: ToString

	void AsyncCopy::ToString(const ValueList& args, SharedValue result)
	{
		result->SetString("[Async Copy]");
	}
开发者ID:jonnymind,项目名称:titanium_desktop,代码行数:4,代码来源:async_copy.cpp

示例13: _GetVersion

	void ComponentBinding::_GetVersion(const ValueList& args, SharedValue result)
	{
		result->SetString(this->component->version);
	}
开发者ID:jonnymind,项目名称:kroll,代码行数:4,代码来源:component_binding.cpp

示例14: _GetPath

	void ComponentBinding::_GetPath(const ValueList& args, SharedValue result)
	{
		result->SetString(this->component->path);
	}
开发者ID:jonnymind,项目名称:kroll,代码行数:4,代码来源:component_binding.cpp

示例15: GetGUID

	void AppBinding::GetGUID(const ValueList& args, SharedValue result)
	{
		std::string guid = host->GetApplication()->guid;
		result->SetString(guid);
	}
开发者ID:jonnymind,项目名称:titanium_desktop,代码行数:5,代码来源:app_binding.cpp


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