本文整理汇总了C++中CMyString::GetLength方法的典型用法代码示例。如果您正苦于以下问题:C++ CMyString::GetLength方法的具体用法?C++ CMyString::GetLength怎么用?C++ CMyString::GetLength使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CMyString
的用法示例。
在下文中一共展示了CMyString::GetLength方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: memcmp
bool const operator>(CMyString const& a, CMyString const& b)
{
int const result = memcmp(a.GetStringData(), b.GetStringData(), min(a.GetLength(), b.GetLength()));
if (result != 0)
{
return (result > 0);
}
return (a.GetLength() > b.GetLength());
}
示例2: ParseFunction
void CFunc::ParseFunction(CMyString& base, CMyString& type1, CMyString& type2,
CMyString& type3, CMyString& descr) const
{
CMyString type;
ParseFunction(base,type,descr);
int len = type.GetLength();
type1 = firstType(type);
int len1 = type1.GetLength();
if (len1 == len) {
type2 = type3 = type1;
} else {
type2 = firstType(type.Mid(len1));
int len2 = type2.GetLength();
if (len1 + len2 == len) {
type3 = type2;
if (!descr.Found(_T("I")))
type2 = type1;
} else {
type3 = firstType(type.Mid(len1+len2));
}
}
}
示例3: firstChanStr
static CMyString firstChanStr(CMyString& descr)
{
CMyString numStr = _T("1234");
int index = descr.Find(_T("C"));
int iP = descr.Find(_T("P"));
int len = 0;
CMyString chanStr = _T("");
if ((iP >= 0) && (index < 0 || (iP < index))) index = iP;
if ((index < 0) ||
(descr.GetLength() == index + 1) ||
(!numStr.Found(descr[index + 1]))) {
len = 0;
} else {
len = 2;
if ((index > 0) && (descr[index - 1] == 'A')) {
index--;
len++;
}
}
CMyString str = descr.Mid(index,len);
descr = descr.Mid(index + len);
return str;
}
示例4: ExpectStringDataImpl
void ExpectStringDataImpl(const CMyString & s, const char *data, size_t size)
{
BOOST_REQUIRE_EQUAL(s.GetLength(), size - 1);
BOOST_REQUIRE_EQUAL(s.GetStringData(), data);
BOOST_REQUIRE_EQUAL(memcmp(s.GetStringData(), data, size), 0);
}
示例5: VerifyString
void VerifyString(CMyString const & str, size_t length, std::string const & reference)
{
BOOST_CHECK_EQUAL(str.GetLength(), length);
BOOST_CHECK_EQUAL(str.GetStringData(), reference);
}
示例6: CMyString
CMyString::CMyString(CMyString const & other)
: CMyString(other.GetStringData(), other.GetLength())
{
}