本文整理汇总了C++中aurora::LocString::getFirstString方法的典型用法代码示例。如果您正苦于以下问题:C++ LocString::getFirstString方法的具体用法?C++ LocString::getFirstString怎么用?C++ LocString::getFirstString使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类aurora::LocString
的用法示例。
在下文中一共展示了LocString::getFirstString方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: stream
GTEST_TEST_F(LocString, readLocString) {
static const byte kData[] = { 0x17, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x0A, 0x00, 0x00, 0x00,
0x46, 0xC3, 0xB6, 0xC3, 0xB6, 0x62, 0xC3, 0xA4,
0x72, 0x30, 0x01, 0x00, 0x00, 0x00, 0x0A, 0x00,
0x00, 0x00, 0x46, 0xC3, 0xB6, 0xC3, 0xB6, 0x62,
0xC3, 0xA4, 0x72, 0x31 };
Common::MemoryReadStream stream(kData);
Aurora::LocString locString;
locString.readLocString(stream);
EXPECT_EQ(locString.getID(), 23);
EXPECT_TRUE(locString.hasString(Aurora::kLanguageEnglish, Aurora::kLanguageGenderMale ));
EXPECT_TRUE(locString.hasString(Aurora::kLanguageEnglish, Aurora::kLanguageGenderFemale));
EXPECT_STREQ(locString.getString(Aurora::kLanguageEnglish, Aurora::kLanguageGenderMale ).c_str(),
kUTF8String0);
EXPECT_STREQ(locString.getString(Aurora::kLanguageEnglish, Aurora::kLanguageGenderFemale).c_str(),
kUTF8String1);
EXPECT_STREQ(locString.getFirstString().c_str(), kUTF8String0);
EXPECT_STREQ(locString.getString().c_str(), kUTF8String0);
}
示例2:
GTEST_TEST_F(LocString, setString) {
Aurora::LocString locString;
locString.setString(Aurora::kLanguageEnglish, kUTF8String);
EXPECT_TRUE(locString.hasString(Aurora::kLanguageEnglish, Aurora::kLanguageGenderMale ));
EXPECT_TRUE(locString.hasString(Aurora::kLanguageEnglish, Aurora::kLanguageGenderFemale));
EXPECT_STREQ(locString.getString(Aurora::kLanguageEnglish, Aurora::kLanguageGenderMale ).c_str(),
kUTF8String);
EXPECT_STREQ(locString.getString(Aurora::kLanguageEnglish, Aurora::kLanguageGenderFemale).c_str(),
kUTF8String);
EXPECT_STREQ(locString.getFirstString().c_str(), kUTF8String);
EXPECT_STREQ(locString.getString().c_str(), kUTF8String);
}