本文整理汇总了C++中Strings::getString方法的典型用法代码示例。如果您正苦于以下问题:C++ Strings::getString方法的具体用法?C++ Strings::getString怎么用?C++ Strings::getString使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Strings
的用法示例。
在下文中一共展示了Strings::getString方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: addStrings
void Strings::addStrings(const Strings& strings)
{
AutoUpdater autoUpdater(*this);
for (int i = 0; i < strings.getCount(); i++)
add(strings.getString(i).c_str(), strings.getData(i));
}
示例2: equals
bool Strings::equals(const Strings& strings)
{
bool result;
int count = getCount();
result = (count == strings.getCount());
if (result)
{
for (int i = 0; i < count; i++)
if (getString(i) != strings.getString(i))
{
result = false;
break;
}
}
return result;
}
示例3: sizeof
JNIEXPORT jobjectArray JNICALL Java_net_kervala_comicsreader_RarFile_nativeGetEntries(JNIEnv *env, jclass, jstring jFilename)
{
jobjectArray ret = NULL;
const char *filename = env->GetStringUTFChars(jFilename, NULL);
RAROpenArchiveData data;
memset(&data, 0, sizeof(RAROpenArchiveData));
data.ArcName = (char*)filename;
data.OpenMode = RAR_OM_LIST;
HANDLE handle = RAROpenArchive(&data);
if (handle && !data.OpenResult)
{
RARHeaderData header;
memset(&header, 0, sizeof(RARHeaderData));
Strings list;
// read all entries
while (RARReadHeader(handle, &header) == 0)
{
// add file to list only if not a directory
if ((header.Flags & LHD_DIRECTORY) != LHD_DIRECTORY) list.addString(header.FileName);
// skip entry content
int result = RARProcessFile(handle, RAR_SKIP, NULL, NULL);
if (result)
{
LOGE("Unable to process %s, error: %d", header.FileName, result);
}
}
RARCloseArchive(handle);
size_t count = list.size();
if (count > 0)
{
ret = (jobjectArray)env->NewObjectArray(count, env->FindClass("java/lang/String"), NULL);
Strings *tmp = &list;
int i = 0;
while(tmp)
{
env->SetObjectArrayElement(ret, i++, env->NewStringUTF(tmp->getString()));
tmp = tmp->getNext();
}
}
}
else
{
displayError(data.OpenResult, filename);
}
env->ReleaseStringUTFChars(jFilename, filename);
return ret;
}