本文整理汇总了C++中CClipboard::unmarshall方法的典型用法代码示例。如果您正苦于以下问题:C++ CClipboard::unmarshall方法的具体用法?C++ CClipboard::unmarshall怎么用?C++ CClipboard::unmarshall使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CClipboard
的用法示例。
在下文中一共展示了CClipboard::unmarshall方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1:
TEST(CClipboardTests, unmarshall_withTextSize285_getTextIsValid)
{
CClipboard clipboard;
// 285 chars
CString text;
text.append("Synergy is Free and Open Source Software that lets you ");
text.append("easily share your mouse and keyboard between multiple ");
text.append("computers, where each computer has it's own display. No ");
text.append("special hardware is required, all you need is a local area ");
text.append("network. Synergy is supported on Windows, Mac OS X and Linux.");
CString data;
data += (char)0;
data += (char)0;
data += (char)0;
data += (char)1; // 1 format added
data += (char)0;
data += (char)0;
data += (char)0;
data += (char)IClipboard::kText;
data += (char)0; // 285 >> 24 = 285 / (256^3) = 0
data += (char)0; // 285 >> 16 = 285 / (256^2) = 0
data += (char)1; // 285 >> 8 = 285 / (256^1) = 1(.11328125)
data += (char)29; // 285 - 256 = 29
data += text;
clipboard.unmarshall(data, 0);
clipboard.open(0);
CString actual = clipboard.get(IClipboard::kText);
EXPECT_EQ(text, actual);
}