本文整理汇总了C++中CopiedString类的典型用法代码示例。如果您正苦于以下问题:C++ CopiedString类的具体用法?C++ CopiedString怎么用?C++ CopiedString使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了CopiedString类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: Scene_copyClosestFaceTexture
void Scene_copyClosestFaceTexture(SelectionTest& test)
{
CopiedString shader;
if(Scene_BrushGetClosestFaceTexture(GlobalSceneGraph(), test, shader, g_faceTextureClipboard.m_projection, g_faceTextureClipboard.m_flags))
{
TextureBrowser_SetSelectedShader(g_TextureBrowser, shader.c_str());
}
}
示例2: ModelResource
ModelResource(const CopiedString& name) :
m_model(g_nullModel),
m_originalName(name),
m_type(path_get_extension(name.c_str())),
m_loader(0),
m_modified(0),
m_unrealised(1)
{
m_loader = ModelLoader_forType(m_type.c_str());
if(g_realised)
{
realise();
}
}
示例3: path
CGameDescription::CGameDescription(xmlDocPtr pDoc, const CopiedString& gameFile)
{
// read the user-friendly game name
xmlNodePtr pNode = pDoc->children;
while (strcmp((const char*)pNode->name, "game") && pNode != 0)
{
pNode=pNode->next;
}
if (!pNode)
{
Error("Didn't find 'game' node in the game description file '%s'\n", pDoc->URL);
}
for(xmlAttrPtr attr = pNode->properties; attr != 0; attr = attr->next)
{
m_gameDescription.insert(GameDescription::value_type(xmlAttr_getName(attr), xmlAttr_getValue(attr)));
}
{
StringOutputStream path(256);
path << AppPath_get() << gameFile.c_str() << "/";
mGameToolsPath = path.c_str();
}
ASSERT_MESSAGE(file_exists(mGameToolsPath.c_str()), "game directory not found: " << makeQuoted(mGameToolsPath.c_str()));
mGameFile = gameFile;
{
GameDescription::iterator i = m_gameDescription.find("type");
if(i == m_gameDescription.end())
{
globalErrorStream() << "Warning, 'type' attribute not found in '" << reinterpret_cast<const char*>(pDoc->URL) << "'\n";
// default
mGameType = "q3";
}
else
{
mGameType = (*i).second.c_str();
}
}
}
示例4: flush
void flush()
{
if(realised())
{
ModelCache_flush(m_path.c_str(), m_name.c_str());
}
}
示例5: setNode
void setNode(scene::Node* node)
{
ModelCache::iterator i = ModelCache_find(m_path.c_str(), m_name.c_str());
if(i != g_modelCache.end())
{
(*i).value = NodeSmartReference(*node);
}
setModel(NodeSmartReference(*node));
connectMap();
}
示例6: realise
void realise()
{
ASSERT_MESSAGE(m_unrealised != 0, "ModelResource::realise: already realised");
if(--m_unrealised == 0)
{
m_path = rootPath(m_originalName.c_str());
m_name = path_make_relative(m_originalName.c_str(), m_path.c_str());
//globalOutputStream() << "ModelResource::realise: " << m_path.c_str() << m_name.c_str() << "\n";
m_observers.realise();
}
}
示例7: buffer
const char *getLastModelFolderPath(){
if ( g_strLastModelFolder.empty() ) {
GlobalPreferenceSystem().registerPreference( "LastModelFolder", make_property_string( g_strLastModelFolder ) );
if ( g_strLastModelFolder.empty() ) {
StringOutputStream buffer( 1024 );
buffer << g_qeglobals.m_userGamePath.c_str() << "models/";
if ( !file_readable( buffer.c_str() ) ) {
// just go to fsmain
buffer.clear();
buffer << g_qeglobals.m_userGamePath.c_str() << "/";
}
g_strLastModelFolder = buffer.c_str();
}
}
return g_strLastModelFolder.c_str();
}
示例8: evaluate
void evaluate(StringBuffer& output)
{
StringBuffer variable;
bool in_variable = false;
for(const char* i = m_string.c_str(); *i != '\0'; ++i)
{
if(!in_variable)
{
switch(*i)
{
case '[':
in_variable = true;
break;
default:
output.push_back(*i);
break;
}
}
else
{
switch(*i)
{
case ']':
in_variable = false;
output.push_string(build_get_variable(variable.c_str()));
variable.clear();
break;
default:
variable.push_back(*i);
break;
}
}
}
}
示例9: save
bool save()
{
if(!mapSaved())
{
const char* moduleName = findModuleName(GetFileTypeRegistry(), MapFormat::Name(), m_type.c_str());
if(string_not_empty(moduleName))
{
const MapFormat* format = ReferenceAPI_getMapModules().findModule(moduleName);
if(format != 0 && MapResource_save(*format, m_model.get(), m_path.c_str(), m_name.c_str()))
{
mapSave();
return true;
}
}
}
return false;
}
示例10: openTextFile
virtual ArchiveTextFile* openTextFile(const char* name)
{
files_t::iterator i = m_files.find(name);
if(i != m_files.end())
{
return StoredArchiveTextFile::create(name, m_name.c_str(), i->second.m_position, i->second.m_stream_size);
}
return 0;
}
示例11: forEachFile
virtual void forEachFile(VisitorFunc visitor, const char* root)
{
std::vector<Directory*> dirs;
UnixPath path(m_root.c_str());
path.push(root);
dirs.push_back(directory_open(path.c_str()));
while(!dirs.empty() && directory_good(dirs.back()))
{
const char* name = directory_read_and_increment(dirs.back());
if(name == 0)
{
directory_close(dirs.back());
dirs.pop_back();
path.pop();
}
else if(!string_equal(name, ".") && !string_equal(name, ".."))
{
path.push_filename(name);
bool is_directory = file_is_directory(path.c_str());
if(!is_directory)
visitor.file(path_make_relative(path.c_str(), m_root.c_str()));
path.pop();
if(is_directory)
{
path.push(name);
if(!visitor.directory(path_make_relative(path.c_str(), m_root.c_str()), dirs.size()))
dirs.push_back(directory_open(path.c_str()));
else
path.pop();
}
}
}
}
示例12: loadCached
void loadCached()
{
if(g_modelCache_enabled)
{
// cache lookup
ModelCache::iterator i = ModelCache_find(m_path.c_str(), m_name.c_str());
if(i == g_modelCache.end())
{
i = ModelCache_insert(
m_path.c_str(),
m_name.c_str(),
Model_load(m_loader, m_path.c_str(), m_name.c_str(), m_type.c_str())
);
}
setModel((*i).value);
}
else
{
setModel(Model_load(m_loader, m_path.c_str(), m_name.c_str(), m_type.c_str()));
}
}
示例13: setIsModel
void setIsModel(bool newValue)
{
if(newValue && !m_isModel)
{
detachTraverse();
attachModel();
m_nameKeys.setKeyIsName(Static<KeyIsName>::instance().m_keyIsName);
m_model.modelChanged(m_modelKey.c_str());
}
else if(!newValue && m_isModel)
{
detachModel();
attachTraverse();
m_nameKeys.setKeyIsName(keyIsNameDoom3Doom3Group);
}
m_isModel = newValue;
updateTransform();
}
示例14: dataVersion
XMLElementParser& pushElement(const XMLElement& element)
{
if(string_equal(element.name(), m_elementName.c_str()))
{
Version dataVersion(version_parse(element.attribute("version")));
if(version_compatible(m_version, dataVersion))
{
m_compatible = true;
return m_parser;
}
else
{
return m_skip;
}
}
else
{
//ERROR_MESSAGE("parse error: invalid element \"" << element.name() << "\"");
return *this;
}
}
示例15: containsFile
virtual bool containsFile(const char* name)
{
UnixPath path(m_root.c_str());
path.push_filename(name);
return file_readable(path.c_str());
}