当前位置: 首页>>代码示例>>C++>>正文


C++ AnsiString::toLowercase方法代码示例

本文整理汇总了C++中AnsiString::toLowercase方法的典型用法代码示例。如果您正苦于以下问题:C++ AnsiString::toLowercase方法的具体用法?C++ AnsiString::toLowercase怎么用?C++ AnsiString::toLowercase使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在AnsiString的用法示例。


在下文中一共展示了AnsiString::toLowercase方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: loadFile

bool BaseSprite::loadFile(const Common::String &filename, int lifeTime, TSpriteCacheType cacheType) {
	Common::SeekableReadStream *file = BaseFileManager::getEngineInstance()->openFile(filename);
	if (!file) {
		BaseEngine::LOG(0, "BaseSprite::LoadFile failed for file '%s'", filename.c_str());
		if (_gameRef->_debugDebugMode) {
			return loadFile("invalid_debug.bmp", lifeTime, cacheType);
		} else {
			return loadFile("invalid.bmp", lifeTime, cacheType);
		}
	} else {
		BaseFileManager::getEngineInstance()->closeFile(file);
		file = nullptr;
	}

	bool ret = STATUS_FAILED;

	AnsiString filePrefix = filename;
	AnsiString ext = PathUtil::getExtension(filename);
	ext.toLowercase();
	filePrefix.toLowercase();
	if (filePrefix.hasPrefix("savegame:") || (ext == "bmp") || (ext == "tga") || (ext == "png") || (ext == "jpg")) {
		BaseFrame *frame = new BaseFrame(_gameRef);
		BaseSubFrame *subframe = new BaseSubFrame(_gameRef);
		subframe->setSurface(filename, true, 0, 0, 0, lifeTime, true);
		if (subframe->_surface == nullptr) {
			BaseEngine::LOG(0, "Error loading simple sprite '%s'", filename.c_str());
			ret = STATUS_FAILED;
			delete frame;
			delete subframe;
		} else {
			subframe->setDefaultRect();
			frame->_subframes.add(subframe);
			_frames.add(frame);
			_currentFrame = 0;
			ret = STATUS_OK;
		}
	} else {
		char *buffer = (char *)BaseFileManager::getEngineInstance()->readWholeFile(filename);
		if (buffer) {
			if (DID_FAIL(ret = loadBuffer(buffer, true, lifeTime, cacheType))) {
				BaseEngine::LOG(0, "Error parsing SPRITE file '%s'", filename.c_str());
			} else {
				ret = STATUS_OK;
			}
			delete[] buffer;
		}
	}

	setFilename(filename.c_str());

	return ret;
}
开发者ID:dergunov,项目名称:scummvm,代码行数:52,代码来源:base_sprite.cpp

示例2: addScriptTime

void ScEngine::addScriptTime(const char *filename, uint32 time) {
	if (!_isProfiling) {
		return;
	}

	AnsiString fileName = filename;
	fileName.toLowercase();
	_scriptTimes[fileName] += time;
}
开发者ID:Fyre91,项目名称:scummvm,代码行数:9,代码来源:script_engine.cpp

示例3: normalizeFileName

AnsiString PathUtil::normalizeFileName(const AnsiString &path) {
	AnsiString newPath = unifySeparators(path);
	newPath.toLowercase();
	return newPath;
}
开发者ID:CobaltBlues,项目名称:scummvm,代码行数:5,代码来源:path_util.cpp


注:本文中的AnsiString::toLowercase方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。