本文整理汇总了C++中TStringList::GetCount方法的典型用法代码示例。如果您正苦于以下问题:C++ TStringList::GetCount方法的具体用法?C++ TStringList::GetCount怎么用?C++ TStringList::GetCount使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类TStringList
的用法示例。
在下文中一共展示了TStringList::GetCount方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1:
BOOST_FIXTURE_TEST_CASE(test7, base_fixture_t)
{
TStringList Lines;
Lines.SetSorted(true);
if (1)
{
Lines.SetDuplicates(dupAccept);
Lines.Add(L"aaa");
Lines.Add(L"aaa");
Lines.Add(L"bbb");
BOOST_CHECK(3 == Lines.GetCount());
BOOST_CHECK(0 == Lines.IndexOf(L"aaa"));
BOOST_CHECK(2 == Lines.IndexOf(L"bbb"));
}
Lines.Clear();
if (1)
{
Lines.SetDuplicates(dupIgnore);
Lines.Add(L"aaa");
Lines.Add(L"aaa");
Lines.Add(L"bbb");
BOOST_CHECK(2 == Lines.GetCount());
BOOST_CHECK(1 == Lines.IndexOf(L"bbb"));
}
Lines.Clear();
if (1)
{
Lines.SetDuplicates(dupError);
Lines.Add(L"aaa");
Lines.Add(L"bbb");
BOOST_CHECK_THROW(Lines.Add(L"aaa"), std::exception);
}
}
示例2: WriteStringList
void TIniFile::WriteStringList(const wxString & Section, const wxString & Ident,
TStringList& Value)
{
EraseSection(Section);
for (int i = 0; i < Value.GetCount(); i++)
{
this->WriteString(Section, wxString::Format("%s%d", Ident, (i)),
Value.Item(i));
}
}
示例3: SetListBoxItems
void SetListBoxItems(wxListBox *lb, TStringList sl)
{
lb->Clear();
if (sl.GetCount() > 0)
{
for (size_t i = 0; i < sl.Count(); i++)
{
wxString st = sl.Item(i);
lb->Append(st);
}
}
}
示例4: FarWrapText
BOOST_FIXTURE_TEST_CASE(test1, base_fixture_t)
{
if (1)
{
UnicodeString Text = ::StringOfChar(' ', 4);
BOOST_CHECK_EQUAL(" ", W2MB(Text.c_str()).c_str());
}
if (1)
{
UnicodeString Message = L"long long long long long long long long long text";
TStringList MessageLines;
int MaxMessageWidth = 20;
FarWrapText(Message, &MessageLines, MaxMessageWidth);
BOOST_TEST_MESSAGE("MessageLines = " << W2MB(MessageLines.GetText().c_str()));
BOOST_CHECK_EQUAL(4, MessageLines.GetCount());
BOOST_CHECK_EQUAL("long long long", W2MB(MessageLines.GetString(0).c_str()).c_str());
BOOST_CHECK_EQUAL("long long long", W2MB(MessageLines.GetString(1).c_str()).c_str());
BOOST_CHECK_EQUAL("long long long", W2MB(MessageLines.GetString(2).c_str()).c_str());
BOOST_CHECK_EQUAL("text", W2MB(MessageLines.GetString(3).c_str()).c_str());
}
}
示例5: ConfigureW
}
int WINAPI ConfigureW(int item)
{
DebugAssert(FarPlugin);
TFarPluginGuard Guard;
return static_cast<int>(FarPlugin->Configure(static_cast<intptr_t>(item)));
}
HANDLE WINAPI OpenPluginW(int openFrom, intptr_t item)
{
SELF_TEST(
UnicodeString Text = L"text, text text, text text1\ntext text text, text text2\n";
TStringList Lines;
Lines.SetCommaText(Text);
assert(Lines.GetCount() == 5);
UnicodeString Instructions = L"Using keyboard authentication.\x0A\x0A\x0APlease enter your password.";
UnicodeString Instructions2 = ReplaceStrAll(Instructions, L"\x0D\x0A", L"\x01");
Instructions2 = ReplaceStrAll(Instructions2, L"\x0A\x0D", L"\x01");
Instructions2 = ReplaceStrAll(Instructions2, L"\x0A", L"\x01");
Instructions2 = ReplaceStrAll(Instructions2, L"\x0D", L"\x01");
Instructions2 = ReplaceStrAll(Instructions2, L"\x01", L"\x0D\x0A");
assert(wcscmp(Instructions2.c_str(), UnicodeString(L"Using keyboard authentication.\x0D\x0A\x0D\x0A\x0D\x0APlease enter your password.").c_str()) == 0);
)
DebugAssert(FarPlugin);
TFarPluginGuard Guard;
return FarPlugin->OpenPlugin(openFrom, item);
}
void WINAPI ClosePluginW(HANDLE Plugin)