本文整理汇总了C++中common::String::toLowercase方法的典型用法代码示例。如果您正苦于以下问题:C++ String::toLowercase方法的具体用法?C++ String::toLowercase怎么用?C++ String::toLowercase使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类common::String
的用法示例。
在下文中一共展示了String::toLowercase方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: getFileFromCache
LipSync *ResourceLoader::loadLipSync(const char *filename) {
Common::String fname = filename;
fname.toLowercase();
LipSync *result;
Block *b = getFileFromCache(fname.c_str());
if (!b) {
b = getFileBlock(fname.c_str());
if (!b)
return NULL;
}
result = new LipSync(filename, b->data(), b->len());
// Some lipsync files have no data
if (result->isValid()) {
putIntoCache(fname, b);
_lipsyncs.push_back(result);
} else {
delete result;
delete b;
result = NULL;
}
return result;
}
示例2: oGeisha_checkData
void Inter_Geisha::oGeisha_checkData(OpFuncParams ¶ms) {
Common::String file = _vm->_game->_script->evalString();
int16 varOff = _vm->_game->_script->readVarIndex();
file.toLowercase();
if (file.hasSuffix(".0ot"))
file.setChar('t', file.size() - 3);
bool exists = false;
SaveLoad::SaveMode mode = _vm->_saveLoad->getSaveMode(file.c_str());
if (mode == SaveLoad::kSaveModeNone) {
exists = _vm->_dataIO->hasFile(file);
if (!exists) {
// NOTE: Geisha looks if fin.tot exists to check if it needs to open disk3.stk.
// This is completely normal, so don't print a warning.
if (file != "fin.tot")
warning("File \"%s\" not found", file.c_str());
}
} else if (mode == SaveLoad::kSaveModeSave)
exists = _vm->_saveLoad->getSize(file.c_str()) >= 0;
else if (mode == SaveLoad::kSaveModeExists)
exists = true;
WRITE_VAR_OFFSET(varOff, exists ? 50 : (uint32)-1);
}
示例3: if
Video::VideoDecoder *ZVision::loadAnimation(const Common::String &fileName) {
Common::String tmpFileName = fileName;
tmpFileName.toLowercase();
Video::VideoDecoder *animation = NULL;
if (tmpFileName.hasSuffix(".rlf"))
animation = new RLFDecoder();
else if (tmpFileName.hasSuffix(".avi"))
animation = new ZorkAVIDecoder();
#ifdef USE_MPEG2
else if (tmpFileName.hasSuffix(".vob"))
animation = new Video::MPEGPSDecoder();
#endif
else
error("Unknown suffix for animation %s", fileName.c_str());
Common::File *_file = getSearchManager()->openFile(tmpFileName);
if (!_file)
error("Error opening %s", tmpFileName.c_str());
bool loaded = animation->loadStream(_file);
if (!loaded)
error("Error loading animation %s", tmpFileName.c_str());
return animation;
}
示例4: Sword1CheckDirectory
void Sword1CheckDirectory(const Common::FSList &fslist, bool *filesFound, bool recursion = false) {
for (Common::FSList::const_iterator file = fslist.begin(); file != fslist.end(); ++file) {
if (!file->isDirectory()) {
// The required game data files can be located in the game directory, or in
// a subdirectory called "clusters". In the latter case, we don't want to
// detect the game in that subdirectory, as this will detect the game twice
// when mass add is searching inside a directory. In this case, the first
// result (the game directory) will be correct, but the second result (the
// clusters subdirectory) will be wrong, as the optional speech, music and
// video data files will be ignored. Note that this fix will skip the game
// data files if the user has placed them inside a "clusters" subdirectory,
// or if he/she points ScummVM directly to the "clusters" directory of the
// game CD. Fixes bug #3049346.
Common::String directory = file->getParent().getName();
directory.toLowercase();
if (directory.hasPrefix("clusters") && directory.size() <= 9 && !recursion)
continue;
const char *fileName = file->getName().c_str();
for (int cnt = 0; cnt < NUM_FILES_TO_CHECK; cnt++)
if (scumm_stricmp(fileName, g_filesToCheck[cnt]) == 0)
filesFound[cnt] = true;
} else {
for (int cnt = 0; cnt < ARRAYSIZE(g_dirNames); cnt++)
if (scumm_stricmp(file->getName().c_str(), g_dirNames[cnt]) == 0) {
Common::FSList fslist2;
if (file->getChildren(fslist2, Common::FSNode::kListFilesOnly))
Sword1CheckDirectory(fslist2, filesFound, true);
}
}
}
}
示例5: if
Audio::RewindableAudioStream *makeRawZorkStream(const Common::String &filePath, ZVision *engine) {
Common::File *file = new Common::File();
assert(file->open(filePath));
Common::String fileName = getFileName(filePath);
fileName.toLowercase();
SoundParams soundParams;
if (engine->getGameId() == GID_NEMESIS) {
for (int i = 0; i < 6; ++i) {
if (RawZorkStream::_zNemSoundParamLookupTable[i].identifier == (fileName[6]))
soundParams = RawZorkStream::_zNemSoundParamLookupTable[i];
}
}
else if (engine->getGameId() == GID_GRANDINQUISITOR) {
for (int i = 0; i < 6; ++i) {
if (RawZorkStream::_zgiSoundParamLookupTable[i].identifier == (fileName[7]))
soundParams = RawZorkStream::_zgiSoundParamLookupTable[i];
}
}
if (soundParams.packed) {
return makeRawZorkStream(wrapBufferedSeekableReadStream(file, 2048, DisposeAfterUse::YES), soundParams.rate, soundParams.stereo, DisposeAfterUse::YES);
} else {
byte flags = 0;
if (soundParams.stereo)
flags |= Audio::FLAG_STEREO;
return Audio::makeRawStream(file, soundParams.rate, flags, DisposeAfterUse::YES);
}
}
示例6: tokenizer
Audio::RewindableAudioStream *makeRawZorkStream(const Common::String &filePath, ZVision *engine) {
Common::File *file = new Common::File();
Common::String actualName = filePath;
bool found = engine->getSearchManager()->openFile(*file, actualName);
bool isRaw = actualName.hasSuffix(".raw");
if ((!found && isRaw) || (found && isRaw && file->size() < 10)) {
if (found)
file->close();
// Check for an audio patch (.src)
actualName.setChar('s', actualName.size() - 3);
actualName.setChar('r', actualName.size() - 2);
actualName.setChar('c', actualName.size() - 1);
if (!engine->getSearchManager()->openFile(*file, actualName))
return NULL;
} else if (!found && !isRaw) {
return NULL;
}
// Get the file name
Common::StringTokenizer tokenizer(actualName, "/\\");
Common::String fileName;
while (!tokenizer.empty()) {
fileName = tokenizer.nextToken();
}
fileName.toLowercase();
const SoundParams *soundParams = NULL;
if (engine->getGameId() == GID_NEMESIS) {
for (int i = 0; i < 32; ++i) {
if (RawZorkStream::_zNemSoundParamLookupTable[i].identifier == (fileName[6]))
soundParams = &RawZorkStream::_zNemSoundParamLookupTable[i];
}
} else if (engine->getGameId() == GID_GRANDINQUISITOR) {
for (int i = 0; i < 24; ++i) {
if (RawZorkStream::_zgiSoundParamLookupTable[i].identifier == (fileName[7]))
soundParams = &RawZorkStream::_zgiSoundParamLookupTable[i];
}
}
if (soundParams == NULL)
return NULL;
if (soundParams->packed) {
return makeRawZorkStream(wrapBufferedSeekableReadStream(file, 2048, DisposeAfterUse::YES), soundParams->rate, soundParams->stereo, DisposeAfterUse::YES);
} else {
byte flags = 0;
if (soundParams->bits16)
flags |= Audio::FLAG_16BITS | Audio::FLAG_LITTLE_ENDIAN;
if (soundParams->stereo)
flags |= Audio::FLAG_STEREO;
return Audio::makePCMStream(file, soundParams->rate, flags, DisposeAfterUse::YES);
}
}
示例7: POSIXFilesystemFactory
OSystem_Android::OSystem_Android(int audio_sample_rate, int audio_buffer_size) :
_audio_sample_rate(audio_sample_rate),
_audio_buffer_size(audio_buffer_size),
_screen_changeid(0),
_egl_surface_width(0),
_egl_surface_height(0),
_htc_fail(true),
_force_redraw(false),
_game_texture(0),
_overlay_texture(0),
_mouse_texture(0),
_mouse_texture_palette(0),
_mouse_texture_rgb(0),
_mouse_hotspot(),
_mouse_keycolor(0),
_use_mouse_palette(false),
_graphicsMode(0),
_fullscreen(true),
_ar_correction(true),
_show_mouse(false),
_show_overlay(false),
_enable_zoning(false),
_mixer(0),
_shake_offset(0),
_queuedEventTime(0),
_event_queue_lock(createMutex()),
_touch_pt_down(),
_touch_pt_scroll(),
_touch_pt_dt(),
_eventScaleX(100),
_eventScaleY(100),
// TODO put these values in some option dlg?
_touchpad_mode(true),
_touchpad_scale(66),
_dpad_scale(4),
_fingersDown(0),
_trackball_scale(2),
_joystick_scale(10) {
_fsFactory = new POSIXFilesystemFactory();
Common::String mf = getSystemProperty("ro.product.manufacturer");
LOGI("Running on: [%s] [%s] [%s] [%s] [%s] SDK:%s ABI:%s",
mf.c_str(),
getSystemProperty("ro.product.model").c_str(),
getSystemProperty("ro.product.brand").c_str(),
getSystemProperty("ro.build.fingerprint").c_str(),
getSystemProperty("ro.build.display.id").c_str(),
getSystemProperty("ro.build.version.sdk").c_str(),
getSystemProperty("ro.product.cpu.abi").c_str());
mf.toLowercase();
/*_htc_fail = mf.contains("htc");
if (_htc_fail)
LOGI("Enabling HTC workaround");*/
}
示例8: canLoadResource
bool SoundEngine::canLoadResource(const Common::String &fileName) {
Common::String fname = fileName;
debugC(1, kDebugSound, "SoundEngine::canLoadResource(%s)", fileName.c_str());
fname.toLowercase();
return fname.hasSuffix(".ogg");
}
示例9: getFontByUsage
const Font *FontManager::getFontByName(const Common::String &name) const {
for (int i = 0; builtinFontNames[i].name; i++)
if (!scumm_stricmp(name.c_str(), builtinFontNames[i].name))
return getFontByUsage(builtinFontNames[i].id);
Common::String lowercaseName = name;
lowercaseName.toLowercase();
if (!_fontMap.contains(lowercaseName))
return 0;
return _fontMap[lowercaseName];
}
示例10: getAnimationEmi
AnimationEmiPtr ResourceLoader::getAnimationEmi(const Common::String &fname) {
Common::String filename = fname;
filename.toLowercase();
for (Common::List<AnimationEmi *>::const_iterator i = _emiAnims.begin(); i != _emiAnims.end(); ++i) {
AnimationEmi *a = *i;
if (filename == a->getFilename()) {
return a;
}
}
return loadAnimationEmi(fname);
}
示例11: getLipSync
LipSyncPtr ResourceLoader::getLipSync(const Common::String &fname) {
Common::String filename = fname;
filename.toLowercase();
for (Common::List<LipSync *>::const_iterator i = _lipsyncs.begin(); i != _lipsyncs.end(); ++i) {
LipSync *l = *i;
if (filename == l->getFilename()) {
return l;
}
}
return loadLipSync(fname);
}
示例12: getColormap
CMapPtr ResourceLoader::getColormap(const Common::String &fname) {
Common::String filename = fname;
filename.toLowercase();
for (Common::List<CMap *>::const_iterator i = _colormaps.begin(); i != _colormaps.end(); ++i) {
CMap *c = *i;
if (filename.equals(c->_fname)) {
return c;
}
}
return loadColormap(fname);
}
示例13: getKeyframe
KeyframeAnimPtr ResourceLoader::getKeyframe(const Common::String &fname) {
Common::String filename = fname;
filename.toLowercase();
for (Common::List<KeyframeAnim *>::const_iterator i = _keyframeAnims.begin(); i != _keyframeAnims.end(); ++i) {
KeyframeAnim *k = *i;
if (filename == k->getFilename()) {
return k;
}
}
return loadKeyframe(fname);
}
示例14: getModel
ModelPtr ResourceLoader::getModel(const Common::String &fname, CMap *c) {
Common::String filename = fname;
filename.toLowercase();
for (Common::List<Model *>::const_iterator i = _models.begin(); i != _models.end(); ++i) {
Model *m = *i;
if (filename == m->_fname && *m->_cmap == *c) {
return m;
}
}
return loadModel(fname, c);
}
示例15:
CachedArchive::CachedArchive(const FileInputList &files)
: _files() {
for (FileInputList::const_iterator i = files.begin(); i != files.end(); ++i) {
Entry entry;
entry.data = i->data;
entry.size = i->size;
Common::String name = i->name;
name.toLowercase();
_files[name] = entry;
}
}