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


C++ String::data方法代码示例

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


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

示例1: CustomCommand

bool SkypekitTestEngine::CustomCommand(const Sid::String &cmd, Sid::String &result_str) {
	TI_FUNCLOG;
	result_str = "Hi! I got your ";
	result_str += cmd;
	TI_DBG("CustomCommand: got %s, answer: %s", cmd.data(), result_str.data());
	return true;
}
开发者ID:goodinges,项目名称:Ciao-Chat,代码行数:7,代码来源:SkypekitTestEngine.cpp

示例2:

bool iMX27RtpInterface::CustomCommand(const Sid::String& cmd, Sid::String& result_str) {
	RTP_FUNCLOG;
	result_str = "Hi! I got your ";
	result_str += cmd;
	RTP_DBG("CustomCommand: got %s, answer: %s", cmd.data(), result_str.data());
	return true;
}
开发者ID:goodinges,项目名称:Ciao-Chat,代码行数:7,代码来源:iMX27RtpInterface.cpp

示例3: main

int main(int argc, const char **argv) {
	OptionsParser parser;
	if (parser.ParseOptions(argc, argv) < 0 || parser.m_Help) {
		parser.Usage(argv[0]);
		return -1;
	}

	Sid::SkypePCMInterfaceServer *pcmif_server = new Sid::SkypePCMInterfaceServer();
	Sid::SkypePCMCallbackInterfaceClient *pcmif_cb_client = new Sid::SkypePCMCallbackInterfaceClient();

	SkypePCMInterface* pcmif = SkypePCMInterfaceGet(pcmif_cb_client);
	pcmif_server->set_if(pcmif);


	Sid::String fromskypekitkey;
	Sid::String toskypekitkey;

	fromskypekitkey.Format( "%spcm_from_skypekit_key", parser.m_IpcPrefix);
	toskypekitkey.Format( "%spcm_to_skypekit_key", parser.m_IpcPrefix);

	pcmif_server->Connect(fromskypekitkey.data(), 0);
	pcmif_cb_client->Connect(toskypekitkey.data(), 500);

	if(parser.m_OutFile)
	{
	  Sid::String cmd;
	  Sid::String response;
	  cmd.Format("OUT:%s",parser.m_OutFile);
	  pcmif->CustomCommand(cmd, response);
	}
	if(parser.m_InFile)
	{
	  Sid::String cmd;
	  Sid::String response;
	  cmd.Format("IN:%s",parser.m_InFile);
	  pcmif->CustomCommand(cmd,response);
	}
	if(parser.m_Loop)
	{
	  Sid::String cmd = "LOOP:1";
	  Sid::String response;
	  pcmif->CustomCommand("LOOP:1", response);
	}
	
	Sid::Protocol::Status status;
	do {
		status =pcmif_server->ProcessCommands();
	} while (status == Sid::Protocol::OK);

	SkypePCMInterfaceRelease(pcmif);
	pcmif_server->Disconnect();
	pcmif_cb_client->Disconnect();

	delete pcmif_server;
	delete pcmif_cb_client;

	printf("PCMServerTransport disconnected, exiting from pcmtesthost\n");
}
开发者ID:goodinges,项目名称:Ciao-Chat,代码行数:58,代码来源:SidPCMHostMainFile.cpp

示例4: checkConversion

void checkConversion(const Sid::String& test, const char* expected)
{
    const char* origData = test.data();
    CPPUNIT_ASSERT_PRINTF(!strcmp(test, expected),
    			"operator const char* did not yield \"%s\" as "
    			"expected, got \"%s\" instead.\n",
    			test.isNull() ? "(NULL)" : (const char*)test,
    			expected);
    CPPUNIT_ASSERT_MESSAGE("operator const char*() causes object to relinquish its reference!",
                            origData == test.data());
}
开发者ID:nosilence,项目名称:jira-skype-app,代码行数:11,代码来源:test_string.cpp

示例5: checkNotStartWith

void checkNotStartWith(const Sid::String& test, const Sid::String& prefix)
{
    const char* origData = test.data();
    CPPUNIT_ASSERT_PRINTF(!test.startWith(prefix),
    			"startsWith() did not return false for "
    			"\n%s\n%s\n",
    			prefix.isNull() ? "(NULL)" : prefix.data(),
    			test.isNull() ? "(NULL)" : test.data());
    CPPUNIT_ASSERT_MESSAGE("startWith() causes object to relinquish its reference!",
                            origData == test.data());
}
开发者ID:nosilence,项目名称:jira-skype-app,代码行数:11,代码来源:test_string.cpp

示例6: checkToBool

void checkToBool(const Sid::String& test, bool expected)
{
    const char* origData = test.data();
    bool res = test.toBool();
    CPPUNIT_ASSERT_PRINTF(res == expected,
                            "toBool() yielded unexpected result for value "
                            "\"%s\", should have been %s\n",
                            test.isNull() ? "(NULL)" : test.data(),
                            expected ? "true" : "false");
    CPPUNIT_ASSERT_MESSAGE("toBool() causes object to relinquish its reference!",
                            origData == test.data());
}
开发者ID:nosilence,项目名称:jira-skype-app,代码行数:12,代码来源:test_string.cpp

示例7: checkToUInt64

void checkToUInt64(const Sid::String& test, uint64 expected)
{
    const char* origData = test.data();
    uint64 res = test.toUInt64();
    CPPUNIT_ASSERT_PRINTF(res == expected,
                            "toUInt64() yielded unexpected result for value "
                            "\"%s\", should have been %ull, instead got %ull\n",
                            test.isNull() ? "(NULL)" : test.data(),
                            expected,
                            res);
    CPPUNIT_ASSERT_MESSAGE("toUInt64() causes object to relinquish its reference!",
                            origData == test.data());
}
开发者ID:nosilence,项目名称:jira-skype-app,代码行数:13,代码来源:test_string.cpp

示例8: checkHexRepresentation

void checkHexRepresentation(const Sid::String& test, const Sid::String& expected)
{
    const char* origData = test.data();
    Sid::String res = test.getHexRepresentation();
    CPPUNIT_ASSERT_PRINTF(res == expected,
                            "getHexRepresentation() yielded unexpected result for value "
                            "\"%s\", should have been \"%s\", instead got \"%s\"\n",
                            test.isNull() ? "(NULL)" : test.data(),
                            expected.isNull() ? "(NULL)" : expected.data(),
                            res.isNull() ? "(NULL)" : res.data());    
    CPPUNIT_ASSERT_MESSAGE("getHexRepresentation() causes object to relinquish its reference!",
                            origData == test.data());
}
开发者ID:nosilence,项目名称:jira-skype-app,代码行数:13,代码来源:test_string.cpp

示例9: checkUnescaping

void checkUnescaping(const Sid::String& test, const Sid::String& expected)
{
    const char* origData = test.data();
    Sid::String unescaped=test.unescape();
    CPPUNIT_ASSERT_PRINTF(unescaped == expected,
    			"Unescaping \"%s\" did not yield \"%s\" as "
    			"expected, instead yielded \"%s\"\n",
    			!test.isNull() ? test.data() : "(NULL)",
    			!expected.isNull() ? expected.data() : "(NULL)",
    			!unescaped.isNull() ? unescaped.data() : "(NULL)");
    CPPUNIT_ASSERT_MESSAGE("unescape() causes object to relinquish its reference!",
                            origData == test.data());
}
开发者ID:nosilence,项目名称:jira-skype-app,代码行数:13,代码来源:test_string.cpp

示例10: checkToBinary

void checkToBinary(const Sid::String& test, const char* expected, size_t expectedSize)
{
    const char* origData = test.data();
    char* res = new char[test.size()+1];
    size_t size = test.toBinary(res);
    CPPUNIT_ASSERT_PRINTF(size == expectedSize,
                            "toBinary() yielded a result that was too long, "
                            "expected %u, got %u\n",
                            expectedSize,
                            size);
    CPPUNIT_ASSERT_PRINTF(!memcmp(expected, res, size),
                            "%s",
                            "toBinary() yielded unexpected result\n");
    CPPUNIT_ASSERT_MESSAGE("toBinary() causes object to relinquish its reference!",
                            origData == test.data());
}
开发者ID:nosilence,项目名称:jira-skype-app,代码行数:16,代码来源:test_string.cpp

示例11: checkFrom

void checkFrom(bool b, const Sid::String& expected)
{
    Sid::String from = Sid::String::from(b);
    CPPUNIT_ASSERT_PRINTF(from == expected,
                            "from((bool)%s) yielded unexpected result \"%s\"\n",
                            b ? "true" : "false",
                            from.isNull() ? "(NULL)" : from.data());
}
开发者ID:nosilence,项目名称:jira-skype-app,代码行数:8,代码来源:test_string.cpp

示例12: checkRight

void checkRight(const Sid::String& test, 
    	unsigned int len,
    	const Sid::String& expected)
{
    const char* origData = test.data();
    Sid::String right = test.right(len);
    CPPUNIT_ASSERT_PRINTF(right == expected,
    			"right(%d) did not yield expected result for:\n"
    			"%s\n%*s (got)\n%*s (expected)\n",
    			len,
    			test.isNull() ? "(NULL)" : test.data(),
    			test.size(),
    			right.isNull() ? "(NULL)" : right.data(),
    			test.size(),
    			expected.isNull() ? "(NULL)" : expected.data());
    CPPUNIT_ASSERT_MESSAGE("right() causes object to relinquish its reference!",
                            origData == test.data());
}
开发者ID:nosilence,项目名称:jira-skype-app,代码行数:18,代码来源:test_string.cpp

示例13: checkAssignment

void checkAssignment(const Sid::String& test,
                        const Sid::String& rhs,
                        const Sid::String& expected)
{
    Sid::String copy(test);
    const char* rhsData = rhs.data();
    copy = rhs;
    CPPUNIT_ASSERT_PRINTF(copy == expected,
                            "Assignment operator yielded unexpected result:\n"
                            "\"%s\" (lhs)\n"
                            "\"%s\" (rhs)\n"
                            "\"%s\" (expected)\n"
                            "\"%s\" (got)\n",
                            test.isNull() ? "(NULL)" : test.data(),
                            rhs.isNull() ? "(NULL)" : rhs.data(),
                            expected.isNull() ? "(NULL)" : rhs.data(),
                            copy.isNull() ? "(NULL)" : copy.data());
    CPPUNIT_ASSERT_MESSAGE("Assignment operator caused rhs to relinquish its reference!",
                            rhs.data() == rhsData);
}
开发者ID:nosilence,项目名称:jira-skype-app,代码行数:20,代码来源:test_string.cpp

示例14: checkAppend

void checkAppend(const Sid::String& lhs, 
                    const char* rhs, 
                    const Sid::String& expected)
{
    Sid::String test(lhs);
    CPPUNIT_ASSERT(test == lhs);
    test += rhs;
    CPPUNIT_ASSERT_PRINTF(test == expected,
                            "operator+=(const char*) yielded unexpected"
                            " result:\n"
                            "lhs was  \"%s\"\n"
                            "rhs was  \"%s\"\n"
                            "expected \"%s\"\n"
                            "got      \"%s\"\n",
                            lhs.isNull() ? "(NULL)" : lhs.data(),
                            rhs ?  rhs : "(NULL)",
                            expected.isNull() ? "(NULL)" : expected.data(),
                            test.isNull() ? "(NULL)" : test.data());

    checkAppend(lhs, Sid::String(rhs), expected);
}
开发者ID:nosilence,项目名称:jira-skype-app,代码行数:21,代码来源:test_string.cpp

示例15: checkFind

void checkFind(const Sid::String& test, 
    			char toFind,
    			int expected)
{
    int res = test.find(toFind);
    CPPUNIT_ASSERT_PRINTF(res == expected,
    						"find(%u) yielded unexpected result %d for string:\n"
    						"%s\n"
    						"expected %d\n",
    						toFind,
    						res,
    						test.isNull() ? "(NULL)" : test.data(),
    						expected);
}
开发者ID:nosilence,项目名称:jira-skype-app,代码行数:14,代码来源:test_string.cpp


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