bool m_bChkOk;
_QERFaceData texInfo;
-CopiedString m_shader;
+std::string m_shader;
vec3_t points[3]; // djbob:do we really need these any more?
vec3_t normal;
float _d;
#define Q3R_CMD_SHOW_2D "Toggle portals (2D)"
#define Q3R_CMD_OPTIONS "Configure Portal Viewer"
-CopiedString INIfn;
+std::string INIfn;
/////////////////////////////////////////////////////////////////////////////
// CPrtViewApp construction
};
private:
-CopiedString m_string;
+std::string m_string;
Observer& m_observer;
public:
StringPreference( Observer& observer )
/// \brief An ArchiveFile which is stored uncompressed as part of a larger archive file.
class StoredArchiveFile : public ArchiveFile
{
-CopiedString m_name;
+std::string m_name;
FileInputStream m_filestream;
SubFileInputStream m_substream;
FileInputStream::size_type m_size;
/// \brief An ArchiveTextFile which is stored uncompressed as part of a larger archive file.
class StoredArchiveTextFile : public ArchiveTextFile
{
-CopiedString m_name;
+std::string m_name;
FileInputStream m_filestream;
SubFileInputStream m_substream;
BinaryToTextInputStream<SubFileInputStream> m_textStream;
/// \brief An ArchiveFile which is stored as a single file on disk.
class DirectoryArchiveFile : public ArchiveFile
{
-CopiedString m_name;
+std::string m_name;
FileInputStream m_istream;
FileInputStream::size_type m_size;
public:
/// \brief An ArchiveTextFile which is stored as a single file on disk.
class DirectoryArchiveTextFile : public ArchiveTextFile
{
-CopiedString m_name;
+std::string m_name;
TextFileInputStream m_inputStream;
public:
struct HashString
{
typedef hash_t hash_type;
- hash_type operator()( const CopiedString& string ) const {
+ hash_type operator()( const std::string& string ) const {
return string_hash( string.c_str() );
}
};
struct HashStringNoCase
{
typedef hash_t hash_type;
- hash_type operator()( const CopiedString& string ) const {
+ hash_type operator()( const std::string& string ) const {
return string_hash_nocase( string.c_str() );
}
};
{
void testStuff(){
// HashTable example
- typedef HashTable<CopiedString, int, HashString> MyHashTable;
+ typedef HashTable<std::string, int, HashString> MyHashTable;
MyHashTable hashtable;
hashtable["bleh"] = 5;
hashtable.insert( "blah", 17 );
class ListAttributeType
{
-typedef std::pair<CopiedString, CopiedString> ListItem;
+typedef std::pair<std::string, std::string> ListItem;
typedef std::vector<ListItem> ListItems;
ListItems m_items;
public:
class EntityClassAttribute
{
public:
-CopiedString m_type;
-CopiedString m_name;
-CopiedString m_value;
-CopiedString m_description;
+std::string m_type;
+std::string m_name;
+std::string m_value;
+std::string m_description;
EntityClassAttribute(){
}
EntityClassAttribute( const char* type, const char* name, const char* value = "", const char* description = "" ) : m_type( type ), m_name( name ), m_value( value ), m_description( description ){
}
};
-typedef std::pair<CopiedString, EntityClassAttribute> EntityClassAttributePair;
+typedef std::pair<std::string, EntityClassAttribute> EntityClassAttributePair;
typedef std::list<EntityClassAttributePair> EntityClassAttributes;
-typedef std::list<CopiedString> StringList;
+typedef std::list<std::string> StringList;
inline const char* EntityClassAttributePair_getName( const EntityClassAttributePair& attributePair ){
if ( !string_empty( attributePair.second.m_name.c_str() ) ) {
class EntityClass
{
public:
-CopiedString m_name;
+std::string m_name;
StringList m_parent;
bool fixedsize;
bool unknown; // wasn't found in source
Shader* m_state_wire;
Shader* m_state_blend;
-CopiedString m_comments;
+std::string m_comments;
char flagnames[MAX_FLAGS][32];
-CopiedString m_modelpath;
-CopiedString m_skin;
+std::string m_modelpath;
+std::string m_skin;
void ( *free )( EntityClass* );
std::size_t m_refcount;
KeyObservers m_observers;
-CopiedString m_string;
+std::string m_string;
const char* m_empty;
-ObservedUndoableObject<CopiedString> m_undo;
+ObservedUndoableObject<std::string> m_undo;
static EntityCreator::KeyValueChangedFunc m_entityKeyValueChanged;
public:
}
}
-void importState( const CopiedString& string ){
+void importState( const std::string& string ){
m_string = string;
notify();
}
-typedef MemberCaller1<KeyValue, const CopiedString&, &KeyValue::importState> UndoImportCaller;
+typedef MemberCaller1<KeyValue, const std::string&, &KeyValue::importState> UndoImportCaller;
};
/// \brief An unsorted list of key/value pairs.
/// \brief The resource is released when the ResourceReference is destroyed.
class ResourceReference
{
- CopiedString m_name;
+ std::string m_name;
Resource* m_resource;
public:
ResourceReference( const char* name )
{
class Path
{
-CopiedString m_path;
+std::string m_path;
unsigned int m_depth;
public:
Path( const char* path )
filetype_copy_t( const filetype_pair_t& other )
: m_moduleName( other.m_moduleName ), m_name( other.m_type.name ), m_pattern( other.m_type.pattern ){
}
- CopiedString m_moduleName;
- CopiedString m_name;
- CopiedString m_pattern;
+ std::string m_moduleName;
+ std::string m_name;
+ std::string m_pattern;
};
typedef std::list<filetype_copy_t> Types;
{
const FileTypeList& m_types;
public:
-std::vector<CopiedString> m_filters;
-std::vector<CopiedString> m_masks;
+std::vector<std::string> m_filters;
+std::vector<std::string> m_masks;
GTKMasks( const FileTypeList& types ) : m_types( types ){
m_masks.reserve( m_types.size() );
}
filetype_pair_t GetTypeForGTKMask( const char *mask ) const {
- std::vector<CopiedString>::const_iterator j = m_masks.begin();
+ std::vector<std::string>::const_iterator j = m_masks.begin();
for ( FileTypeList::const_iterator i = m_types.begin(); i != m_types.end(); ++i, ++j )
{
if ( string_equal( ( *j ).c_str(), mask ) ) {
namespace
{
-CopiedString g_bitmapsPath;
+std::string g_bitmapsPath;
}
void BitmapsPath_set( const char* path ){
class NameableString : public Nameable
{
-CopiedString m_name;
+std::string m_name;
public:
NameableString( const char* name )
: m_name( name ){
template<typename Type>
class ModulesMap : public Modules<Type>
{
-typedef std::map<CopiedString, Module*> modules_t;
+typedef std::map<std::string, Module*> modules_t;
modules_t m_modules;
public:
~ModulesMap(){
class shader_less_t
{
public:
-bool operator()( const CopiedString& shader, const CopiedString& other ) const {
+bool operator()( const std::string& shader, const std::string& other ) const {
return shader_less( shader.c_str(), other.c_str() );
}
};
+++ /dev/null
-/*
- Copyright (C) 2001-2006, William Joseph.
- All Rights Reserved.
-
- This file is part of GtkRadiant.
-
- GtkRadiant is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 2 of the License, or
- (at your option) any later version.
-
- GtkRadiant is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with GtkRadiant; if not, write to the Free Software
- Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#include "string.h"
-
-/// \note Never called...
-void TestString(){
- CopiedString bleh( "bleh" );
- //SmartString blah( "blah" );
-}
}
};
-#if 0
-/// \brief A non-mutable c-style string.
-///
-/// \param Buffer The string storage implementation. Must be DefaultConstructible, CopyConstructible and Assignable. Must implement:
-/// \li Buffer(const char* string) - constructor which copies a c-style \p string.
-/// \li Buffer(const char* first, const char*) - constructor which copies a c-style string range [\p first, \p last).
-/// \li void swap(Buffer& other) - swaps contents with \p other.
-/// \li const char* c_str() - returns the stored non-mutable c-style string.
-template<typename Buffer>
-class String : public Buffer
-{
-public:
-
-String()
- : Buffer(){
-}
-String( const char* string )
- : Buffer( string ){
-}
-String( StringRange range )
- : Buffer( range ){
-}
-
-String& operator=( const String& other ){
- String temp( other );
- temp.swap( *this );
- return *this;
-}
-String& operator=( const char* string ){
- String temp( string );
- temp.swap( *this );
- return *this;
-}
-String& operator=( StringRange range ){
- String temp( range );
- temp.swap( *this );
- return *this;
-}
-
-void swap( String& other ){
- Buffer::swap( other );
-}
-
-bool empty() const {
- return string_empty( Buffer::c_str() );
-}
-};
-
-template<typename Buffer>
-inline bool operator<( const String<Buffer>& self, const String<Buffer>& other ){
- return string_less( self.c_str(), other.c_str() );
-}
-
-template<typename Buffer>
-inline bool operator>( const String<Buffer>& self, const String<Buffer>& other ){
- return string_greater( self.c_str(), other.c_str() );
-}
-
-template<typename Buffer>
-inline bool operator==( const String<Buffer>& self, const String<Buffer>& other ){
- return string_equal( self.c_str(), other.c_str() );
-}
-
-template<typename Buffer>
-inline bool operator!=( const String<Buffer>& self, const String<Buffer>& other ){
- return !string_equal( self.c_str(), other.c_str() );
-}
-
-template<typename Buffer>
-inline bool operator==( const String<Buffer>& self, const char* other ){
- return string_equal( self.c_str(), other );
-}
-
-template<typename Buffer>
-inline bool operator!=( const String<Buffer>& self, const char* other ){
- return !string_equal( self.c_str(), other );
-}
-
-namespace std
-{
-/// \brief Swaps the values of \p self and \p other.
-/// Overloads std::swap.
-template<typename Buffer>
-inline void swap( String<Buffer>& self, String<Buffer>& other ){
- self.swap( other );
-}
-}
-
-
-/// \brief A non-mutable string buffer which manages memory allocation.
-template<typename Allocator>
-class CopiedBuffer : private Allocator
-{
-char* m_string;
-
-char* copy_range( StringRange range ){
- return string_clone_range( range, static_cast<Allocator&>( *this ) );
-}
-char* copy( const char* other ){
- return string_clone( other, static_cast<Allocator&>( *this ) );
-}
-void destroy( char* string ){
- string_release( string, string_length( string ), static_cast<Allocator&>( *this ) );
-}
-
-protected:
-~CopiedBuffer(){
- destroy( m_string );
-}
-public:
-CopiedBuffer()
- : m_string( copy( "" ) ){
-}
-explicit CopiedBuffer( const Allocator& allocator )
- : Allocator( allocator ), m_string( copy( "" ) ){
-}
-CopiedBuffer( const CopiedBuffer& other )
- : Allocator( other ), m_string( copy( other.m_string ) ){
-}
-CopiedBuffer( const char* string, const Allocator& allocator = Allocator() )
- : Allocator( allocator ), m_string( copy( string ) ){
-}
-CopiedBuffer( StringRange range, const Allocator& allocator = Allocator() )
- : Allocator( allocator ), m_string( copy_range( range ) ){
-}
-const char* c_str() const {
- return m_string;
-}
-void swap( CopiedBuffer& other ){
- string_swap( m_string, other.m_string );
-}
-};
-
-/// \brief A non-mutable string which uses copy-by-value for assignment.
-typedef String< CopiedBuffer< DefaultAllocator<char> > > CopiedString;
-
-/// \brief A non-mutable string buffer which uses reference-counting to avoid unnecessary allocations.
-template<typename Allocator>
-class SmartBuffer : private Allocator
-{
-char* m_buffer;
-
-char* copy_range( StringRange range ){
- char* buffer = Allocator::allocate( sizeof( std::size_t ) + ( range.last - range.first ) + 1 );
- strncpy( buffer + sizeof( std::size_t ), range.first, range.last - range.first );
- buffer[sizeof( std::size_t ) + ( range.last - range.first )] = '\0';
- *reinterpret_cast<std::size_t*>( buffer ) = 0;
- return buffer;
-}
-char* copy( const char* string ){
- char* buffer = Allocator::allocate( sizeof( std::size_t ) + string_length( string ) + 1 );
- strcpy( buffer + sizeof( std::size_t ), string );
- *reinterpret_cast<std::size_t*>( buffer ) = 0;
- return buffer;
-}
-void destroy( char* buffer ){
- Allocator::deallocate( buffer, sizeof( std::size_t ) + string_length( c_str() ) + 1 );
-}
-
-void incref( char* buffer ){
- ++( *reinterpret_cast<std::size_t*>( buffer ) );
-}
-void decref( char* buffer ){
- if ( --( *reinterpret_cast<std::size_t*>( buffer ) ) == 0 ) {
- destroy( buffer );
- }
-}
-
-protected:
-~SmartBuffer(){
- decref( m_buffer );
-}
-public:
-SmartBuffer()
- : m_buffer( copy( "" ) ){
- incref( m_buffer );
-}
-explicit SmartBuffer( const Allocator& allocator )
- : Allocator( allocator ), m_buffer( copy( "" ) ){
- incref( m_buffer );
-}
-SmartBuffer( const SmartBuffer& other )
- : Allocator( other ), m_buffer( other.m_buffer ){
- incref( m_buffer );
-}
-SmartBuffer( const char* string, const Allocator& allocator = Allocator() )
- : Allocator( allocator ), m_buffer( copy( string ) ){
- incref( m_buffer );
-}
-SmartBuffer( StringRange range, const Allocator& allocator = Allocator() )
- : Allocator( allocator ), m_buffer( copy_range( range ) ){
- incref( m_buffer );
-}
-const char* c_str() const {
- return m_buffer + sizeof( std::size_t );
-}
-void swap( SmartBuffer& other ){
- string_swap( m_buffer, other.m_buffer );
-}
-};
-
-/// \brief A non-mutable string which uses copy-by-reference for assignment of SmartString.
-typedef String< SmartBuffer< DefaultAllocator<char> > > SmartString;
-#endif
-
-typedef std::string CopiedString;
-
class StringEqualNoCase
{
public:
-bool operator()( const CopiedString& key, const CopiedString& other ) const {
+bool operator()( const std::string& key, const std::string& other ) const {
return string_equal_nocase( key.c_str(), other.c_str() );
}
};
struct StringLessNoCase
{
- bool operator()( const CopiedString& x, const CopiedString& y ) const {
+ bool operator()( const std::string& x, const std::string& y ) const {
return string_less_nocase( x.c_str(), y.c_str() );
}
};
+++ /dev/null
-/*
- Copyright (C) 2001-2006, William Joseph.
- All Rights Reserved.
-
- This file is part of GtkRadiant.
-
- GtkRadiant is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 2 of the License, or
- (at your option) any later version.
-
- GtkRadiant is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with GtkRadiant; if not, write to the Free Software
- Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#include "stringfwd.h"
+++ /dev/null
-/*
- Copyright (C) 2001-2006, William Joseph.
- All Rights Reserved.
-
- This file is part of GtkRadiant.
-
- GtkRadiant is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 2 of the License, or
- (at your option) any later version.
-
- GtkRadiant is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with GtkRadiant; if not, write to the Free Software
- Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#if !defined( INCLUDED_STRING_STRINGFWD_H )
-#define INCLUDED_STRING_STRINGFWD_H
-
-#include <string>
-
-// forward-declaration of CopiedString
-
-template<typename Type>
-class DefaultAllocator;
-/*template<typename Allocator>
-class CopiedBuffer;
-template<typename Buffer>
-class String;
-typedef String< CopiedBuffer< DefaultAllocator<char> > > CopiedString;*/
-typedef std::string CopiedString;
-
-#endif
-inline void CopiedString_importString( CopiedString& self, const char* string ){
+inline void CopiedString_importString( std::string& self, const char* string ){
self = string;
}
-typedef ReferenceCaller1<CopiedString, const char*, CopiedString_importString> CopiedStringImportStringCaller;
-inline void CopiedString_exportString( const CopiedString& self, const StringImportCallback& importer ){
+typedef ReferenceCaller1<std::string, const char*, CopiedString_importString> CopiedStringImportStringCaller;
+inline void CopiedString_exportString( const std::string& self, const StringImportCallback& importer ){
importer( self.c_str() );
}
-typedef ConstReferenceCaller1<CopiedString, const StringImportCallback&, CopiedString_exportString> CopiedStringExportStringCaller;
+typedef ConstReferenceCaller1<std::string, const StringImportCallback&, CopiedString_exportString> CopiedStringExportStringCaller;
inline void Bool_importString( bool& self, const char* string ){
self = string_equal( string, "true" );
#endif
-typedef std::pair<CopiedString, Postfix> name_t;
+typedef std::pair<std::string, Postfix> name_t;
inline void name_write( char* buffer, name_t name ){
strcpy( buffer, name.first.c_str() );
end = p;
}
- return name_t( CopiedString( StringRange( name, end ) ), Postfix( end ) );
+ return name_t( std::string( StringRange( name, end ) ), Postfix( end ) );
}
class UniqueNames
{
-typedef std::map<CopiedString, PostFixes> names_t;
+typedef std::map<std::string, PostFixes> names_t;
names_t m_names;
public:
name_t make_unique( const name_t& name ) const {
///\brief All string pointers passed to an instance of this class are copied.
class DynamicElement : public XMLElement
{
-typedef std::map<CopiedString, CopiedString> attrs_t;
+typedef std::map<std::string, std::string> attrs_t;
public:
DynamicElement( const char* name )
: m_name( name ){
}
}
private:
-CopiedString m_name;
+std::string m_name;
attrs_t m_attrs;
};
}
//int XmlTagBuilder::RenameShaderTag(const char* oldtag, const char* newtag)
-int XmlTagBuilder::RenameShaderTag( const char* oldtag, CopiedString newtag ){
+int XmlTagBuilder::RenameShaderTag( const char* oldtag, std::string newtag ){
/* Replaces tag node contents
char* oldtag - the <tag></tag> node content that sould be changed
strcat( expression, tag );
strcat( expression, "']" );
- std::set<CopiedString> dellist;
+ std::set<std::string> dellist;
TagSearch( expression, dellist );
- std::set<CopiedString>::iterator iter;
+ std::set<std::string>::iterator iter;
for ( iter = dellist.begin(); iter != dellist.end(); iter++ )
{
return true;
}
-void XmlTagBuilder::GetShaderTags( const char* shader, std::vector<CopiedString>& tags ){
+void XmlTagBuilder::GetShaderTags( const char* shader, std::vector<std::string>& tags ){
/* Gets the tags from a shader
char* shader - the name of the shader
if ( !xmlXPathNodeSetIsEmpty( nodePtr ) ) {
for ( int i = 0; i < nodePtr->nodeNr; i++ )
{
- tags.push_back( (CopiedString)(char*)xmlNodeGetContent( nodePtr->nodeTab[i] ) );
+ tags.push_back( (std::string)(char*)xmlNodeGetContent( nodePtr->nodeTab[i] ) );
}
}
xmlXPathFreeObject( xpathPtr );
}
-void XmlTagBuilder::GetUntagged( std::set<CopiedString>& shaders ){
+void XmlTagBuilder::GetUntagged( std::set<std::string>& shaders ){
/* Gets all textures and shaders listed in the xml file that don't have any tag
returns a set containing the shaders (with path)
xmlXPathFreeObject( xpathPtr );
}
-void XmlTagBuilder::GetAllTags( std::set<CopiedString>& tags ){
+void XmlTagBuilder::GetAllTags( std::set<std::string>& tags ){
/* Gets a list of all tags that are used (assigned to any shader)
returns a set containing all used tags
if ( !xmlXPathNodeSetIsEmpty( nodePtr ) ) {
for ( int i = 0; i < nodePtr->nodeNr; i++ )
{
- tags.insert( (CopiedString)(char*)xmlNodeGetContent( nodePtr->nodeTab[i] ) );
+ tags.insert( (std::string)(char*)xmlNodeGetContent( nodePtr->nodeTab[i] ) );
}
}
xmlXPathFreeObject( xpathPtr );
}
-void XmlTagBuilder::TagSearch( const char* expression, std::set<CopiedString>& paths ){
+void XmlTagBuilder::TagSearch( const char* expression, std::set<std::string>& paths ){
/* Searches shaders by tags
char* expression - the XPath expression to search
{
ptr = nodePtr->nodeTab[i];
xmlattrib = xmlGetProp( ptr, (const xmlChar*)"path" );
- paths.insert( (CopiedString)(char*)xmlattrib );
+ paths.insert( (std::string)(char*)xmlattrib );
}
}
xmlXPathFreeObject( xpathPtr );
class XmlTagBuilder
{
private:
-CopiedString m_savefilename;
+std::string m_savefilename;
xmlDocPtr doc;
xmlXPathContextPtr context;
xmlNodeSetPtr nodePtr;
bool CheckShaderTag( const char* shader, const char* content );
bool AddShaderTag( const char* shader, const char* content, NodeTagType nodeTagType );
bool DeleteTag( const char* tag );
-int RenameShaderTag( const char* oldtag, CopiedString newtag );
+int RenameShaderTag( const char* oldtag, std::string newtag );
bool DeleteShaderTag( const char* shader, const char* tag );
-void GetShaderTags( const char* shader, std::vector<CopiedString>& tags );
-void GetUntagged( std::set<CopiedString>& shaders );
-void GetAllTags( std::set<CopiedString>& tags );
-void TagSearch( const char* expression, std::set<CopiedString>& paths );
+void GetShaderTags( const char* shader, std::vector<std::string>& tags );
+void GetUntagged( std::set<std::string>& shaders );
+void GetAllTags( std::set<std::string>& tags );
+void TagSearch( const char* expression, std::set<std::string>& paths );
};
#endif
typedef GenericFileSystem<PakRecord> PakFileSystem;
PakFileSystem m_filesystem;
FileInputStream m_pakfile;
-CopiedString m_name;
+std::string m_name;
public:
eWAD3,
};
-typedef std::map<CopiedString, wad_record_t, StringLessNoCase> files_t;
+typedef std::map<std::string, wad_record_t, StringLessNoCase> files_t;
files_t m_files;
-CopiedString m_name;
+std::string m_name;
FileInputStream m_wadfile;
EWadVersion wad_version( const char* identification ){
class DeflatedArchiveFile : public ArchiveFile
{
-CopiedString m_name;
+std::string m_name;
FileInputStream m_istream;
SubFileInputStream m_substream;
DeflatedInputStream m_zipstream;
class DeflatedArchiveTextFile : public ArchiveTextFile
{
-CopiedString m_name;
+std::string m_name;
FileInputStream m_istream;
SubFileInputStream m_substream;
DeflatedInputStream m_zipstream;
typedef GenericFileSystem<ZipRecord> ZipFileSystem;
ZipFileSystem m_filesystem;
-CopiedString m_name;
+std::string m_name;
FileInputStream m_istream;
bool read_record(){
Callback m_transformChanged;
Callback m_evaluateTransform;
-CopiedString m_name;
-CopiedString m_modelKey;
+std::string m_name;
+std::string m_modelKey;
bool m_isModel;
scene::Traversable* m_traversable;
class ShaderRef
{
-CopiedString m_name;
+std::string m_name;
Shader* m_shader;
void capture(){
m_shader = GlobalShaderCache().capture( m_name.c_str() );
#include "entitylib.h"
#include "traverselib.h"
-inline void parseTextureName( CopiedString& name, const char* token ){
+inline void parseTextureName( std::string& name, const char* token ){
StringOutputStream cleaned( 256 );
cleaned << PathCleaned( token );
name = StringRange( cleaned.c_str(), path_get_filename_base_end( cleaned.c_str() ) ); // remove extension
class ModelSkinKey : public ModuleObserver
{
-CopiedString m_name;
+std::string m_name;
ModelSkin* m_skin;
Callback m_skinChangedCallback;
{
EntityKeyValues& m_entity;
NameCallbackSet m_changed;
-CopiedString m_name;
+std::string m_name;
public:
NamedEntity( EntityKeyValues& entity ) : m_entity( entity ){
}
NameKeys( const NameKeys& other );
NameKeys& operator=( const NameKeys& other );
-typedef std::map<CopiedString, EntityKeyValue*> KeyValues;
+typedef std::map<std::string, EntityKeyValue*> KeyValues;
KeyValues m_keyValues;
void insertName( const char* key, EntityKeyValue& value ){
#include "modulesystem/singletonmodule.h"
#include "stringio.h"
-void parseShaderName( CopiedString& name, const char* token ){
+void parseShaderName( std::string& name, const char* token ){
StringOutputStream cleaned( 256 );
cleaned << PathCleaned( token );
name = cleaned.c_str();
class Doom3ModelSkin
{
-typedef std::map<CopiedString, CopiedString> Remaps;
+typedef std::map<std::string, std::string> Remaps;
Remaps m_remaps;
public:
bool parseTokens( Tokeniser& tokeniser ){
}
else
{
- CopiedString from, to;
+ std::string from, to;
parseShaderName( from, token );
tokeniser.nextLine(); // hack to handle badly formed skins
class GlobalSkins
{
public:
-typedef std::map<CopiedString, Doom3ModelSkin> SkinMap;
+typedef std::map<std::string, Doom3ModelSkin> SkinMap;
SkinMap m_skins;
Doom3ModelSkin g_nullSkin;
Tokeniser_unexpectedError( tokeniser, token, "#string" );
return false;
}
- CopiedString name;
+ std::string name;
parseShaderName( name, other );
Doom3ModelSkin& skin = m_skins[name];
RETURN_FALSE_IF_FAIL( skin.parseTokens( tokeniser ) );
explicit CreateDoom3ModelSkin( Doom3ModelSkinCache& cache )
: m_cache( cache ){
}
-Doom3ModelSkinCacheElement* construct( const CopiedString& name ){
+Doom3ModelSkinCacheElement* construct( const std::string& name ){
Doom3ModelSkinCacheElement* skin = new Doom3ModelSkinCacheElement;
if ( m_cache.realised() ) {
skin->realise( name.c_str() );
}
};
-typedef HashedCache<CopiedString, Doom3ModelSkinCacheElement, HashString, std::equal_to<CopiedString>, CreateDoom3ModelSkin> Cache;
+typedef HashedCache<std::string, Doom3ModelSkinCacheElement, HashString, std::equal_to<std::string>, CreateDoom3ModelSkin> Cache;
Cache m_cache;
bool m_realised;
#include "targetable.h"
-typedef std::map<CopiedString, targetables_t> targetnames_t;
+typedef std::map<std::string, targetables_t> targetnames_t;
const char* g_targetable_nameKey = "targetname";
}
-typedef std::list< std::pair<CopiedString, CopiedString> > KeyValues;
+typedef std::list< std::pair<std::string, std::string> > KeyValues;
NodeSmartReference g_nullNode( NewNullNode() );
}
else // epair
{
- CopiedString key( token );
+ std::string key( token );
token = tokeniser.getToken();
if ( token == 0 ) {
Tokeniser_unexpectedError( tokeniser, token, "#epair-value" );
tokeniser.ungetToken();
break;
}
- CopiedString tmp( key );
+ std::string tmp( key );
tokeniser.nextLine();
const char* value = tokeniser.getToken();
tokeniser.nextLine();
return VertexPointer( VertexPointer::pointer( &array->vertex ), sizeof( ArbitraryMeshVertex ) );
}
-inline void parseTextureName( CopiedString& name, const char* token ){
+inline void parseTextureName( std::string& name, const char* token ){
StringOutputStream cleaned( 256 );
cleaned << PathCleaned( token );
name = StringRange( cleaned.c_str(), path_get_filename_base_end( cleaned.c_str() ) ); // remove extension
private:
AABB m_aabb_local;
-CopiedString m_shader;
+std::string m_shader;
Shader* m_state;
vertices_t m_vertices;
class Remap
{
public:
-CopiedString first;
+std::string first;
Shader* second;
Remap() : second( 0 ){
}
public OpenGLRenderable
{
AABB m_aabb_local;
-CopiedString m_shader;
+std::string m_shader;
Shader* m_state;
Array<ArbitraryMeshVertex> m_vertices;
};
-typedef std::pair<CopiedString, int> PicoModelKey;
+typedef std::pair<std::string, int> PicoModelKey;
class PicoModel :
class Remap
{
public:
-CopiedString first;
+std::string first;
Shader* second;
Remap() : second( 0 ){
}
if ( !hasName && ( *ptr == ':' || *ptr == '\0' ) ) {
// model name
hasName = true;
- m_name = CopiedString( s, ptr );
+ m_name = std::string( s, ptr );
s = ptr + 1;
}
else if ( *ptr == '?' || *ptr == '\0' ) {
// model frame
hasFrame = true;
- m_frame = atoi( CopiedString( s, ptr ).c_str() );
+ m_frame = atoi( std::string( s, ptr ).c_str() );
s = ptr + 1;
}
else if ( *ptr == '&' || *ptr == '\0' ) {
// a remap
- add_remap( CopiedString( s, ptr ).c_str() );
+ add_remap( std::string( s, ptr ).c_str() );
s = ptr + 1;
}
return "";
}
-CopiedString m_name;
+std::string m_name;
int m_frame;
PicoModel* m_model;
typedef std::vector<remap_t*> remaps_t;
remaps_t m_remaps;
-typedef std::vector<CopiedString> shaders_t;
+typedef std::vector<std::string> shaders_t;
shaders_t m_shaders;
typedef std::vector<Shader*> states_t;
states_t m_states;
class PicoModelAPIConstructor
{
-CopiedString m_extension;
+std::string m_extension;
const picoModule_t* m_module;
public:
PicoModelAPIConstructor( const char* extension, const picoModule_t* module ) :
typedef PooledString<ShaderPool> ShaderString;
typedef ShaderString ShaderVariable;
typedef ShaderString ShaderValue;
-typedef CopiedString TextureExpression;
+typedef std::string TextureExpression;
// clean a texture name to the qtexture_t name format we use internally
// NOTE: case sensitivity: the engine is case sensitive. we store the shader name with case information and save with case
void parseTextureName( StringType& name, const char* token ){
StringOutputStream cleaned( 256 );
cleaned << PathCleaned( token );
- name = CopiedString( StringRange( cleaned.c_str(), path_get_filename_base_end( cleaned.c_str() ) ) ).c_str(); // remove extension
+ name = std::string( StringRange( cleaned.c_str(), path_get_filename_base_end( cleaned.c_str() ) ) ).c_str(); // remove extension
}
bool Tokeniser_parseTextureName( Tokeniser& tokeniser, TextureExpression& name ){
return true;
}
-bool Tokeniser_parseShaderName( Tokeniser& tokeniser, CopiedString& name ){
+bool Tokeniser_parseShaderName( Tokeniser& tokeniser, std::string& name ){
const char* token = tokeniser.getToken();
if ( token == 0 ) {
Tokeniser_unexpectedError( tokeniser, token, "#shader-name" );
class ShaderTemplate
{
std::size_t m_refcount;
-CopiedString m_Name;
+std::string m_Name;
public:
ShaderParameters m_params;
}
typedef SmartPointer<ShaderTemplate> ShaderTemplatePointer;
-typedef std::map<CopiedString, ShaderTemplatePointer> ShaderTemplateMap;
+typedef std::map<std::string, ShaderTemplatePointer> ShaderTemplateMap;
ShaderTemplateMap g_shaders;
ShaderTemplateMap g_shaderTemplates;
const char* filename;
};
-typedef std::map<CopiedString, ShaderDefinition> ShaderDefinitionMap;
+typedef std::map<std::string, ShaderDefinition> ShaderDefinitionMap;
ShaderDefinitionMap g_shaderDefinitions;
bool parseTemplateInstance( Tokeniser& tokeniser, const char* filename ){
- CopiedString name;
+ std::string name;
RETURN_FALSE_IF_FAIL( Tokeniser_parseShaderName( tokeniser, name ) );
const char* templateName = tokeniser.getToken();
ShaderTemplate* shaderTemplate = findTemplate( templateName );
const ShaderArguments& m_args;
const char* m_filename;
// name is shader-name, otherwise texture-name (if not a real shader)
-CopiedString m_Name;
+std::string m_Name;
qtexture_t* m_pTexture;
qtexture_t* m_notfound;
bool CShader::m_lightingEnabled = false;
typedef SmartPointer<CShader> ShaderPointer;
-typedef std::map<CopiedString, ShaderPointer, shader_less_t> shaders_t;
+typedef std::map<std::string, ShaderPointer, shader_less_t> shaders_t;
shaders_t g_ActiveShaders;
}
};
-std::list<CopiedString> g_shaderFilenames;
+std::list<std::string> g_shaderFilenames;
void ParseShaderFile( Tokeniser& tokeniser, const char* filename ){
g_shaderFilenames.push_back( filename );
tokeniser.ungetToken();
}
// first token should be the path + name.. (from base)
- CopiedString name;
+ std::string name;
if ( !Tokeniser_parseShaderName( tokeniser, name ) ) {
}
ShaderTemplatePointer shaderTemplate( new ShaderTemplate() );
class DirectoryArchive : public Archive
{
-CopiedString m_root;
+std::string m_root;
public:
DirectoryArchive( const char* root ) : m_root( root ){
}
struct archive_entry_t
{
- CopiedString name;
+ std::string name;
Archive* archive;
bool is_pakfile;
};
class PakLess
{
public:
-bool operator()( const CopiedString& self, const CopiedString& other ) const {
+bool operator()( const std::string& self, const std::string& other ) const {
return string_compare_nocase_upper( self.c_str(), other.c_str() ) > 0;
}
};
-typedef std::set<CopiedString, PakLess> Archives;
+typedef std::set<std::string, PakLess> Archives;
// =============================================================================
// Global functions
class SavedState
{
public:
-CopiedString m_shader;
+std::string m_shader;
ContentsFlagsValue m_flags;
SavedState( const FaceShader& faceShader ){
}
};
-CopiedString m_shader;
+std::string m_shader;
Shader* m_state;
ContentsFlagsValue m_flags;
FaceShaderObserverPair m_observers;
class FaceGetShader
{
-CopiedString& m_shader;
+std::string& m_shader;
mutable bool m_done;
public:
-FaceGetShader( CopiedString& shader )
+FaceGetShader( std::string& shader )
: m_shader( shader ), m_done( false ){
}
void operator()( Face& face ) const {
}
};
-void Scene_BrushGetShader_Selected( scene::Graph& graph, CopiedString& shader ){
+void Scene_BrushGetShader_Selected( scene::Graph& graph, std::string& shader ){
#if 1
if ( GlobalSelectionSystem().countSelected() != 0 ) {
BrushInstance* brush = Instance_getBrush( GlobalSelectionSystem().ultimateSelected() );
#endif
}
-void Scene_BrushGetShader_Component_Selected( scene::Graph& graph, CopiedString& shader ){
+void Scene_BrushGetShader_Component_Selected( scene::Graph& graph, std::string& shader ){
#if 1
if ( !g_SelectedFaceInstances.empty() ) {
FaceInstance& faceInstance = g_SelectedFaceInstances.last();
#define INCLUDED_BRUSHWRAPPER_H
#include <cstddef>
-#include "string/stringfwd.h"
+#include <string>
#include "generic/callbackfwd.h"
enum EBrushPrefab
void Scene_BrushRotateTexdef_Component_Selected( scene::Graph& graph, float angle );
void Scene_BrushSetShader_Selected( scene::Graph& graph, const char* name );
void Scene_BrushSetShader_Component_Selected( scene::Graph& graph, const char* name );
-void Scene_BrushGetShader_Selected( scene::Graph& graph, CopiedString& shader );
-void Scene_BrushGetShader_Component_Selected( scene::Graph& graph, CopiedString& shader );
+void Scene_BrushGetShader_Selected( scene::Graph& graph, std::string& shader );
+void Scene_BrushGetShader_Component_Selected( scene::Graph& graph, std::string& shader );
void Scene_BrushFindReplaceShader( scene::Graph& graph, const char* find, const char* replace );
void Scene_BrushFindReplaceShader_Selected( scene::Graph& graph, const char* find, const char* replace );
void Scene_BrushFindReplaceShader_Component_Selected( scene::Graph& graph, const char* find, const char* replace );
#include "mainframe.h"
-typedef std::map<CopiedString, CopiedString> Variables;
+typedef std::map<std::string, std::string> Variables;
Variables g_build_variables;
void build_clear_variables(){
class VariableString : public Evaluatable
{
-CopiedString m_string;
+std::string m_string;
public:
VariableString() : m_string(){
}
}
};
-typedef std::pair<CopiedString, Build> BuildPair;
+typedef std::pair<std::string, Build> BuildPair;
#define SEPARATOR_STRING "-"
static bool is_separator( const BuildPair &p ){
if ( !string_equal( p.first.c_str(), SEPARATOR_STRING ) ) {
return i;
}
-typedef std::map<CopiedString, Tool> Tools;
+typedef std::map<std::string, Tool> Tools;
class ProjectXMLConstructor : public XMLElementParser
{
class RootXMLConstructor : public XMLElementParser
{
-CopiedString m_elementName;
+std::string m_elementName;
XMLElementParser& m_parser;
SkipAllParser m_skip;
Version m_version;
namespace
{
-CopiedString g_buildMenu;
+std::string g_buildMenu;
}
void LoadBuildMenu();
#include "gtkmisc.h"
typedef std::pair<Accelerator, int> ShortcutValue; // accelerator, isRegistered
-typedef std::map<CopiedString, ShortcutValue> Shortcuts;
+typedef std::map<std::string, ShortcutValue> Shortcuts;
void Shortcuts_foreach( Shortcuts& shortcuts, CommandVisitor& visitor ){
for ( Shortcuts::iterator i = shortcuts.begin(); i != shortcuts.end(); ++i )
}
}
-typedef std::map<CopiedString, Command> Commands;
+typedef std::map<std::string, Command> Commands;
Commands g_commands;
return ( *i ).second;
}
-typedef std::map<CopiedString, Toggle> Toggles;
+typedef std::map<std::string, Toggle> Toggles;
Toggles g_toggles;
return ( *i ).second;
}
-typedef std::map<CopiedString, KeyEvent> KeyEvents;
+typedef std::map<std::string, KeyEvent> KeyEvents;
KeyEvents g_keyEvents;
typedef ImportExport<int, int, IntImport, IntExport> IntImportExport;
typedef ImportExport<std::size_t, std::size_t, SizeImport, SizeExport> SizeImportExport;
typedef ImportExport<float, float, FloatImport, FloatExport> FloatImportExport;
-typedef ImportExport<CopiedString, const char*, StringImport, StringExport> StringImportExport;
+typedef ImportExport<std::string, const char*, StringImport, StringExport> StringImportExport;
void Dialog::AddDialogData( GtkRadioButton& widget, int& data ){
AddData<IntRadioImportExport, IntImportExport>( m_data ).apply( widget, data );
}
-void Dialog::AddDialogData( GtkEntry& widget, CopiedString& data ){
+void Dialog::AddDialogData( GtkEntry& widget, std::string& data ){
AddData<TextEntryImportExport, StringImportExport>( m_data ).apply( widget, data );
}
void Dialog::AddDialogData( GtkEntry& widget, int& data ){
return GTK_WIDGET( row );
}
-GtkWidget* Dialog::addPathEntry( GtkWidget* vbox, const char* name, CopiedString& data, bool browse_directory ){
+GtkWidget* Dialog::addPathEntry( GtkWidget* vbox, const char* name, std::string& data, bool browse_directory ){
return addPathEntry( vbox, name, browse_directory, StringImportCallback( StringImportCaller( data ) ), StringExportCallback( StringExportCaller( data ) ) );
}
typedef ReferenceCaller1<float, const FloatImportCallback&, FloatExport> FloatExportCaller;
-inline void StringImport( CopiedString& self, const char* value ){
+inline void StringImport( std::string& self, const char* value ){
self = value;
}
-typedef ReferenceCaller1<CopiedString, const char*, StringImport> StringImportCaller;
-inline void StringExport( CopiedString& self, const StringImportCallback& importCallback ){
+typedef ReferenceCaller1<std::string, const char*, StringImport> StringImportCaller;
+inline void StringExport( std::string& self, const StringImportCallback& importCallback ){
importCallback( self.c_str() );
}
-typedef ReferenceCaller1<CopiedString, const StringImportCallback&, StringExport> StringExportCaller;
+typedef ReferenceCaller1<std::string, const StringImportCallback&, StringExport> StringExportCaller;
class DLG_DATA
return addFloatEntry( vbox, name, FloatImportCaller( data ), FloatExportCaller( data ) );
}
GtkWidget* addPathEntry( GtkWidget* vbox, const char* name, bool browse_directory, const StringImportCallback& importCallback, const StringExportCallback& exportCallback );
-GtkWidget* addPathEntry( GtkWidget* vbox, const char* name, CopiedString& data, bool directory );
+GtkWidget* addPathEntry( GtkWidget* vbox, const char* name, std::string& data, bool directory );
GtkWidget* addSpinner( GtkWidget* vbox, const char* name, int& data, double value, double lower, double upper );
GtkWidget* addSpinner( GtkWidget* vbox, const char* name, double value, double lower, double upper, const IntImportCallback& importCallback, const IntExportCallback& exportCallback );
GtkWidget* addSpinner( GtkWidget* vbox, const char* name, double value, double lower, double upper, const FloatImportCallback& importCallback, const FloatExportCallback& exportCallback );
void AddDialogData( GtkToggleButton& object, bool& data );
void AddDialogData( GtkRadioButton& object, int& data );
-void AddDialogData( GtkEntry& object, CopiedString& data );
+void AddDialogData( GtkEntry& object, std::string& data );
void AddDialogData( GtkEntry& object, int& data );
void AddDialogData( GtkEntry& object, std::size_t& data );
void AddDialogData( GtkEntry& object, float& data );
EntityClasses g_entityClasses;
EntityClass *eclass_bad = 0;
//char eclass_directory[1024];
-typedef std::map<CopiedString, ListAttributeType> ListAttributeTypes;
+typedef std::map<std::string, ListAttributeType> ListAttributeTypes;
ListAttributeTypes g_listTypes;
}
struct PathLess
{
- bool operator()( const CopiedString& path, const CopiedString& other ) const {
+ bool operator()( const std::string& path, const std::string& other ) const {
return path_less( path.c_str(), other.c_str() );
}
};
-typedef std::map<CopiedString, const char*, PathLess> Paths;
+typedef std::map<std::string, const char*, PathLess> Paths;
class PathsInsert
{
const char *debugname;
-void setSpecialLoad( EntityClass *e, const char* pWhat, CopiedString& p ){
+void setSpecialLoad( EntityClass *e, const char* pWhat, std::string& p ){
// Hydra: removed some amazingly bad cstring usage, whoever wrote that
// needs to be taken out and shot.
return true;
}
-bool EntityClassDoom3_parseString( Tokeniser& tokeniser, CopiedString& s ){
+bool EntityClassDoom3_parseString( Tokeniser& tokeniser, std::string& s ){
const char* token = tokeniser.getToken();
PARSE_RETURN_FALSE_IF_FAIL( token != 0 );
s = token;
{
public:
bool m_resolved;
-CopiedString m_mesh;
-CopiedString m_skin;
-CopiedString m_parent;
-typedef std::map<CopiedString, CopiedString> Anims;
+std::string m_mesh;
+std::string m_skin;
+std::string m_parent;
+typedef std::map<std::string, std::string> Anims;
Anims m_anims;
Model() : m_resolved( false ){
}
};
-typedef std::map<CopiedString, Model> Models;
+typedef std::map<std::string, Model> Models;
Models g_models;
}
}
else if ( string_equal( parameter, "anim" ) ) {
- CopiedString animName;
+ std::string animName;
PARSE_RETURN_FALSE_IF_FAIL( EntityClassDoom3_parseString( tokeniser, animName ) );
const char* animFile;
PARSE_RETURN_FALSE_IF_FAIL( EntityClassDoom3_parseString( tokeniser, animFile ) );
StringOutputStream usage( 256 );
StringOutputStream description( 256 );
- CopiedString* currentDescription = 0;
+ std::string* currentDescription = 0;
StringOutputStream* currentString = 0;
for (;; )
PARSE_RETURN_FALSE_IF_FAIL( EntityClassDoom3_parseString( tokeniser, key ) );
const char* last = string_findFirstSpaceOrTab( key );
- CopiedString first( StringRange( key, last ) );
+ std::string first( StringRange( key, last ) );
if ( !string_empty( last ) ) {
last = string_findFirstNonSpaceOrTab( last );
// end ignore prey entity keys
else
{
- CopiedString tmp( key );
+ std::string tmp( key );
ASSERT_MESSAGE( !string_equal_n( key, "editor_", 7 ), "unsupported editor key: " << makeQuoted( key ) );
EntityClassAttribute& attribute = EntityClass_insertAttribute( entityClass, key ).second;
attribute.m_type = "string";
if ( blockType == 0 ) {
return true;
}
- CopiedString tmp( blockType );
+ std::string tmp( blockType );
if ( !EntityClassDoom3_parseBlock( tokeniser, tmp.c_str() ) ) {
globalErrorStream() << GlobalFileSystem().findFile( filename ) << filename << ":" << (unsigned int)tokeniser.getLine() << ": " << tmp.c_str() << " parse failed, skipping rest of file\n";
return false;
typedef std::map<const char*, EntityClass*, RawStringLess> BaseClasses;
BaseClasses g_EntityClassFGD_bases;
EntityClass *g_EntityClassFGD_bad = 0;
-typedef std::map<CopiedString, ListAttributeType> ListAttributeTypes;
+typedef std::map<std::string, ListAttributeType> ListAttributeTypes;
ListAttributeTypes g_listTypesFGD;
}
#define PARSE_ERROR "error parsing entity class definition"
-void EntityClassFGD_parseSplitString( Tokeniser& tokeniser, CopiedString& string ){
+void EntityClassFGD_parseSplitString( Tokeniser& tokeniser, std::string& string ){
StringOutputStream buffer( 256 );
for (;; )
{
for (;; )
{
- CopiedString key = tokeniser.getToken();
+ std::string key = tokeniser.getToken();
if ( string_equal( key.c_str(), "]" ) ) {
tokeniser.nextLine();
break;
ASSERT_MESSAGE( EntityClassFGD_parseToken( tokeniser, ")" ), PARSE_ERROR );
const char* descriptionSeparator = tokeniser.getToken();
if ( string_equal( descriptionSeparator, ":" ) ) {
- CopiedString description;
+ std::string description;
EntityClassFGD_parseSplitString( tokeniser, description );
}
else
}
ASSERT_MESSAGE( EntityClassFGD_parseToken( tokeniser, "(" ), PARSE_ERROR );
- CopiedString type = tokeniser.getToken();
+ std::string type = tokeniser.getToken();
ASSERT_MESSAGE( EntityClassFGD_parseToken( tokeniser, ")" ), PARSE_ERROR );
if ( string_equal_nocase( type.c_str(), "flags" ) ) {
}
else
{
- CopiedString tmp( value );
+ std::string tmp( value );
ASSERT_MESSAGE( EntityClassFGD_parseToken( tokeniser, ":" ), PARSE_ERROR );
const char* name = tokeniser.getToken();
listType.push_back( name, tmp.c_str() );
|| string_equal( name, "integer2" );
}
-typedef std::map<CopiedString, ListAttributeType> ListAttributeTypes;
+typedef std::map<std::string, ListAttributeType> ListAttributeTypes;
bool listAttributeSupported( ListAttributeTypes& listTypes, const char* name ){
return listTypes.find( name ) != listTypes.end();
namespace
{
-typedef std::map<CopiedString, CopiedString> KeyValues;
+typedef std::map<std::string, std::string> KeyValues;
KeyValues g_selectedKeyValues;
KeyValues g_selectedDefaultKeyValues;
}
class BooleanAttribute : public EntityAttribute
{
-CopiedString m_key;
+std::string m_key;
GtkCheckButton* m_check;
static gboolean toggled( GtkWidget *widget, BooleanAttribute* self ){
class StringAttribute : public EntityAttribute
{
-CopiedString m_key;
+std::string m_key;
GtkEntry* m_entry;
NonModalEntry m_nonModal;
public:
class ModelAttribute : public EntityAttribute
{
-CopiedString m_key;
+std::string m_key;
BrowsedPathEntry m_entry;
NonModalEntry m_nonModal;
public:
class SoundAttribute : public EntityAttribute
{
-CopiedString m_key;
+std::string m_key;
BrowsedPathEntry m_entry;
NonModalEntry m_nonModal;
public:
class AngleAttribute : public EntityAttribute
{
-CopiedString m_key;
+std::string m_key;
GtkEntry* m_entry;
NonModalEntry m_nonModal;
public:
class DirectionAttribute : public EntityAttribute
{
-CopiedString m_key;
+std::string m_key;
GtkEntry* m_entry;
NonModalEntry m_nonModal;
RadioHBox m_radio;
class AnglesAttribute : public EntityAttribute
{
-CopiedString m_key;
+std::string m_key;
AnglesEntry m_angles;
NonModalEntry m_nonModal;
GtkBox* m_hbox;
class Vector3Attribute : public EntityAttribute
{
-CopiedString m_key;
+std::string m_key;
Vector3Entry m_vector3;
NonModalEntry m_nonModal;
GtkBox* m_hbox;
class ListAttribute : public EntityAttribute
{
-CopiedString m_key;
+std::string m_key;
GtkComboBox* m_combo;
NonModalComboBox m_nonModal;
const ListAttributeType& m_type;
}
void visit( const char* key, const char* value ){
- m_keyvalues.insert( KeyValues::value_type( CopiedString( key ), CopiedString( value ) ) );
+ m_keyvalues.insert( KeyValues::value_type( std::string( key ), std::string( value ) ) );
}
};
}
const char* keyvalues_valueforkey( KeyValues& keyvalues, const char* key ){
- KeyValues::iterator i = keyvalues.find( CopiedString( key ) );
+ KeyValues::iterator i = keyvalues.find( std::string( key ) );
if ( i != keyvalues.end() ) {
return ( *i ).second.c_str();
}
// save current key/val pair around filling epair box
// row_select wipes it and sets to first in list
- CopiedString strKey( gtk_entry_get_text( g_entityKeyEntry ) );
- CopiedString strVal( gtk_entry_get_text( g_entityValueEntry ) );
+ std::string strKey( gtk_entry_get_text( g_entityKeyEntry ) );
+ std::string strVal( gtk_entry_get_text( g_entityValueEntry ) );
gtk_list_store_clear( store );
// Walk through list and add pairs
namespace
{
-CopiedString home_path;
-CopiedString app_path;
+std::string home_path;
+std::string app_path;
}
const char* environment_get_home_path(){
bool m_can_import;
bool m_can_save;
private:
- CopiedString m_moduleName;
- CopiedString m_name;
- CopiedString m_pattern;
+ std::string m_moduleName;
+ std::string m_name;
+ std::string m_pattern;
};
typedef std::vector<filetype_copy_t> filetype_list_t;
-std::map<CopiedString, filetype_list_t> m_typelists;
+std::map<std::string, filetype_list_t> m_typelists;
public:
RadiantFileTypeRegistry(){
addType( "*", "*", filetype_t( "All Files", "*.*" ) );
bool m_bSelectedOnly;
-CopiedString m_strFind;
-CopiedString m_strReplace;
+std::string m_strFind;
+std::string m_strReplace;
};
FindTextureDialog g_FindTextureDialog;
// =============================================================================
// Add new shader tag dialog
-EMessageBoxReturn DoShaderTagDlg( CopiedString* tag, const char* title ){
+EMessageBoxReturn DoShaderTagDlg( std::string* tag, const char* title ){
ModalDialog dialog;
GtkEntry* textentry;
ModalDialogButton ok_button( dialog, eIDOK );
#else
// custom shader editor
bool g_TextEditor_useCustomEditor = false;
-CopiedString g_TextEditor_editorCommand( "" );
+std::string g_TextEditor_editorCommand( "" );
#endif
void DoTextEditor( const char* filename, int cursorpos ){
#include "string/string.h"
EMessageBoxReturn DoLightIntensityDlg( int *intensity );
-EMessageBoxReturn DoShaderTagDlg( CopiedString *tag, const char* title );
+EMessageBoxReturn DoShaderTagDlg( std::string *tag, const char* title );
EMessageBoxReturn DoShaderInfoDlg( const char* name, const char* filename, const char* title );
EMessageBoxReturn DoTextureLayout( float *fx, float *fy );
void DoTextEditor( const char* filename, int cursorpos );
#ifdef WIN32
extern bool g_TextEditor_useWin32Editor;
#else
-#include "string/stringfwd.h"
+#include <string>
extern bool g_TextEditor_useCustomEditor;
-extern CopiedString g_TextEditor_editorCommand;
+extern std::string g_TextEditor_editorCommand;
#endif
*/
namespace
{
-std::list<CopiedString> mHelpURLs;
+std::list<std::string> mHelpURLs;
}
/*!
needed for hooking in Gtk+
*/
-void HandleHelpCommand( CopiedString& str ){
+void HandleHelpCommand( std::string& str ){
OpenURL( str.c_str() );
}
{
if ( !strcmp( (const char*)pNode->name, "item" ) ) {
// process the URL
- CopiedString url;
+ std::string url;
xmlChar* prop = xmlGetProp( pNode, reinterpret_cast<const xmlChar*>( "url" ) );
ASSERT_NOTNULL( prop );
prop = xmlGetProp( pNode, reinterpret_cast<const xmlChar*>( "name" ) );
ASSERT_NOTNULL( prop );
- create_menu_item_with_mnemonic( menu_in_menu, reinterpret_cast<const char*>( prop ), ReferenceCaller<CopiedString, HandleHelpCommand>( mHelpURLs.back() ) );
+ create_menu_item_with_mnemonic( menu_in_menu, reinterpret_cast<const char*>( prop ), ReferenceCaller<std::string, HandleHelpCommand>( mHelpURLs.back() ) );
xmlFree( prop );
}
pNode = pNode->next;
\link os/path.h os/path.h \endlink - Path manipulation for radiant's standard path format \n
\link os/file.h os/file.h \endlink - OS file-system access. \n
- ::CopiedString - automatic string memory management \n
+ ::std::string - automatic string memory management \n
Array - automatic array memory management \n
HashTable - generic hashtable, similar to std::hash_map \n
// Engine Path
-CopiedString g_strEnginePath;
+std::string g_strEnginePath;
ModuleObservers g_enginePathObservers;
std::size_t g_enginepath_unrealised = 1;
// App Path
-CopiedString g_strAppPath; ///< holds the full path of the executable
+std::string g_strAppPath; ///< holds the full path of the executable
const char* AppPath_get(){
return g_strAppPath.c_str();
/// the path to the local rc-dir
const char* LocalRcPath_get( void ){
- static CopiedString rc_path;
+ static std::string rc_path;
if ( rc_path.empty() ) {
StringOutputStream stream( 256 );
stream << GlobalRadiant().getSettingsPath() << g_pGameDescription->mGameFile.c_str() << "/";
/// directory for temp files
/// NOTE: on *nix this is were we check for .pid
-CopiedString g_strSettingsPath;
+std::string g_strSettingsPath;
const char* SettingsPath_get(){
return g_strSettingsPath.c_str();
}
[GameToolsPath]/modules
and also q3map, bspc
*/
-CopiedString g_strGameToolsPath; ///< this is set by g_GamesDialog
+std::string g_strGameToolsPath; ///< this is set by g_GamesDialog
const char* GameToolsPath_get(){
return g_strGameToolsPath.c_str();
}
-void EnginePathImport( CopiedString& self, const char* value ){
+void EnginePathImport( std::string& self, const char* value ){
setEnginePath( value );
}
-typedef ReferenceCaller1<CopiedString, const char*, EnginePathImport> EnginePathImportCaller;
+typedef ReferenceCaller1<std::string, const char*, EnginePathImport> EnginePathImportCaller;
void Paths_constructPreferences( PreferencesPage& page ){
page.appendPathEntry( "Engine Path", true,
namespace
{
-CopiedString g_gamename;
-CopiedString g_gamemode;
+std::string g_gamename;
+std::string g_gamemode;
ModuleObservers g_gameNameObservers;
ModuleObservers g_gameModeObservers;
}
return false;
}
-typedef std::list<CopiedString> StringStack;
+typedef std::list<std::string> StringStack;
StringStack g_wait_stack;
WaitDialog g_wait;
m_idleRedrawStatusText.queueDraw();
}
-void MainFrame::SetStatusText( CopiedString& status_text, const char* pText ){
+void MainFrame::SetStatusText( std::string& status_text, const char* pText ){
status_text = pText;
UpdateStatusText();
}
GtkWindow* m_window;
-CopiedString m_command_status;
-CopiedString m_position_status;
-CopiedString m_brushcount_status;
-CopiedString m_texture_status;
-CopiedString m_grid_status;
+std::string m_command_status;
+std::string m_position_status;
+std::string m_brushcount_status;
+std::string m_texture_status;
+std::string m_grid_status;
private:
void Create();
}
void OnSleep();
-void SetStatusText( CopiedString& status_text, const char* pText );
+void SetStatusText( std::string& status_text, const char* pText );
void UpdateStatusText();
void RedrawStatusText();
typedef MemberCaller<MainFrame, &MainFrame::RedrawStatusText> RedrawStatusTextCaller;
void Radiant_attachGameToolsPathObserver( ModuleObserver& observer );
void Radiant_detachGameToolsPathObserver( ModuleObserver& observer );
-extern CopiedString g_strEnginePath;
+extern std::string g_strEnginePath;
void EnginePath_verify();
const char* EnginePath_get();
const char* QERApp_GetGamePath();
-extern CopiedString g_strAppPath;
+extern std::string g_strAppPath;
const char* AppPath_get();
-extern CopiedString g_strSettingsPath;
+extern std::string g_strSettingsPath;
const char* SettingsPath_get();
const char* LocalRcPath_get( void );
const char* const g_pluginsDir = "plugins/"; ///< name of plugins directory, always sub-directory of toolspath
const char* const g_modulesDir = "modules/"; ///< name of modules directory, always sub-directory of toolspath
-extern CopiedString g_strGameToolsPath;
+extern std::string g_strGameToolsPath;
const char* GameToolsPath_get();
void Radiant_Initialise();
class NameObserver
{
UniqueNames& m_names;
-CopiedString m_name;
+std::string m_name;
void construct(){
if ( !empty() ) {
void mergeNames( const BasicNamespace& other ) const {
typedef std::list<NameCallback> SetNameCallbacks;
- typedef std::map<CopiedString, SetNameCallbacks> NameGroups;
+ typedef std::map<std::string, SetNameCallbacks> NameGroups;
NameGroups groups;
UniqueNames uniqueNames( other.m_uniqueNames );
class Map : public ModuleObserver
{
public:
-CopiedString m_name;
+std::string m_name;
Resource* m_resource;
bool m_valid;
}
-typedef std::map<CopiedString, std::size_t> EntityBreakdown;
+typedef std::map<std::string, std::size_t> EntityBreakdown;
class EntityBreakdownWalker : public scene::Graph::Walker
{
}
}
-CopiedString g_mapsPath;
+std::string g_mapsPath;
const char* getMapsPath(){
return g_mapsPath.c_str();
#include "preferencesystem.h"
-CopiedString g_strLastMap;
+std::string g_strLastMap;
bool g_bLoadLastMap = false;
void Map_Construct(){
#include "iscenegraph.h"
#include "generic/callback.h"
#include "signal/signalfwd.h"
-#include "string/stringfwd.h"
+#include <string>
class Map;
extern Map g_map;
void SelectBrush( int entitynum, int brushnum );
-extern CopiedString g_strLastMap;
+extern std::string g_strLastMap;
extern bool g_bLoadLastMap;
void Map_Construct();
namespace {
GtkMenuItem *MRU_items[MRU_MAX];
std::size_t MRU_used;
-typedef CopiedString MRU_filename_t;
+typedef std::string MRU_filename_t;
MRU_filename_t MRU_filenames[MRU_MAX];
typedef const char* MRU_key_t;
MRU_key_t MRU_keys[MRU_MAX] = { "File0", "File1", "File2", "File3" };
}
std::size_t m_width, m_height;
-CopiedString m_shader;
+std::string m_shader;
PatchControlArray m_ctrl;
bool m_patchDef3;
std::size_t m_subdivisions_x;
AABB m_aabb_local; // local bbox
-CopiedString m_shader;
+std::string m_shader;
Shader* m_state;
std::size_t m_width;
Patch *m_Patch;
-CopiedString m_strName;
+std::string m_strName;
float m_fS;
float m_fT;
float m_fX;
SceneChangeNotify();
}
-void Scene_PatchGetShader_Selected( scene::Graph& graph, CopiedString& name ){
+void Scene_PatchGetShader_Selected( scene::Graph& graph, std::string& name ){
Patch* patch = Scene_GetUltimateSelectedVisiblePatch();
if ( patch != 0 ) {
name = patch->GetShader();
#if !defined ( INCLUDED_PATCHMANIP_H )
#define INCLUDED_PATCHMANIP_H
-#include "string/stringfwd.h"
+#include <string>
void Patch_registerCommands();
typedef struct _GtkToolbar GtkToolbar;
}
void Scene_PatchSetShader_Selected( scene::Graph& graph, const char* name );
-void Scene_PatchGetShader_Selected( scene::Graph& graph, CopiedString& name );
+void Scene_PatchGetShader_Selected( scene::Graph& graph, std::string& name );
void Scene_PatchSelectByShader( scene::Graph& graph, const char* name );
void Scene_PatchFindReplaceShader( scene::Graph& graph, const char* find, const char* replace );
void Scene_PatchFindReplaceShader_Selected( scene::Graph& graph, const char* find, const char* replace );
/* plugin manager --------------------------------------- */
class CPluginSlot : public IPlugIn
{
-CopiedString m_menu_name;
+std::string m_menu_name;
const _QERPluginTable *mpTable;
-std::list<CopiedString> m_CommandStrings;
-std::list<CopiedString> m_CommandTitleStrings;
+std::list<std::string> m_CommandStrings;
+std::list<std::string> m_CommandTitleStrings;
std::list<std::size_t> m_CommandIDs;
public:
}
const char* CPluginSlot::getCommand( std::size_t n ){
- std::list<CopiedString>::iterator i = m_CommandStrings.begin();
+ std::list<std::string>::iterator i = m_CommandStrings.begin();
while ( n-- != 0 )
++i;
return ( *i ).c_str();
}
const char* CPluginSlot::getCommandTitle( std::size_t n ){
- std::list<CopiedString>::iterator i = m_CommandTitleStrings.begin();
+ std::list<std::string>::iterator i = m_CommandTitleStrings.begin();
while ( n-- != 0 )
++i;
return ( *i ).c_str();
}
};
-typedef std::map<CopiedString, PreferenceEntry> PreferenceEntries;
+typedef std::map<std::string, PreferenceEntry> PreferenceEntries;
PreferenceEntries m_preferences;
-typedef std::map<CopiedString, CopiedString> PreferenceCache;
+typedef std::map<std::string, std::string> PreferenceCache;
PreferenceCache m_cache;
public:
}
ETag m_tag;
- CopiedString m_name;
+ std::string m_name;
StringOutputStream m_ostream;
};
return reinterpret_cast<const char*>( attr->children->content );
}
-CGameDescription::CGameDescription( xmlDocPtr pDoc, const CopiedString& gameFile ){
+CGameDescription::CGameDescription( xmlDocPtr pDoc, const std::string& gameFile ){
// read the user-friendly game name
xmlNodePtr pNode = pDoc->children;
GtkWidget* appendPathEntry( const char* name, bool browse_directory, const StringImportCallback& importCallback, const StringExportCallback& exportCallback ){
return m_dialog.addPathEntry( m_vbox, name, browse_directory, importCallback, exportCallback );
}
-GtkWidget* appendPathEntry( const char* name, CopiedString& data, bool directory ){
+GtkWidget* appendPathEntry( const char* name, std::string& data, bool directory ){
return m_dialog.addPathEntry( m_vbox, name, data, directory );
}
GtkWidget* appendSpinner( const char* name, int& data, double value, double lower, double upper ){
*/
class CGameDescription
{
-typedef std::map<CopiedString, CopiedString> GameDescription;
+typedef std::map<std::string, std::string> GameDescription;
public:
-CopiedString mGameFile; ///< the .game file that describes this game
+std::string mGameFile; ///< the .game file that describes this game
GameDescription m_gameDescription;
-CopiedString mGameToolsPath; ///< the explicit path to the game-dependent modules
-CopiedString mGameType; ///< the type of the engine
+std::string mGameToolsPath; ///< the explicit path to the game-dependent modules
+std::string mGameType; ///< the type of the engine
const char* getKeyValue( const char* key ) const {
GameDescription::const_iterator i = m_gameDescription.find( key );
return "";
}
-CGameDescription( xmlDocPtr pDoc, const CopiedString &GameFile );
+CGameDescription( xmlDocPtr pDoc, const std::string &GameFile );
void Dump();
};
what game has been selected
this is the name of the .game file
*/
-CopiedString m_sGameFile;
+std::string m_sGameFile;
/*!
prompt which game to load on startup
*/
win32: engine full path.
unix: user home full path + engine dir.
*/
- CopiedString m_userEnginePath;
+ std::string m_userEnginePath;
/*!
cache for m_userEnginePath + mod subdirectory.
*/
- CopiedString m_userGamePath;
+ std::string m_userGamePath;
} QEGlobals_t;
struct PathEqual
{
- bool operator()( const CopiedString& path, const CopiedString& other ) const {
+ bool operator()( const std::string& path, const std::string& other ) const {
return path_equal( path.c_str(), other.c_str() );
}
};
struct PathHash
{
typedef hash_t hash_type;
- hash_type operator()( const CopiedString& path ) const {
+ hash_type operator()( const std::string& path ) const {
return path_hash( path.c_str() );
}
};
-typedef std::pair<CopiedString, CopiedString> ModelKey;
+typedef std::pair<std::string, std::string> ModelKey;
struct ModelKeyEqual
{
struct ModelResource : public Resource
{
NodeSmartReference m_model;
- const CopiedString m_originalName;
- CopiedString m_path;
- CopiedString m_name;
- CopiedString m_type;
+ const std::string m_originalName;
+ std::string m_path;
+ std::string m_name;
+ std::string m_type;
ModelLoader* m_loader;
ModuleObservers m_observers;
std::time_t m_modified;
std::size_t m_unrealised;
- ModelResource( const CopiedString& name ) :
+ ModelResource( const std::string& name ) :
m_model( g_nullModel ),
m_originalName( name ),
m_type( path_get_extension( name.c_str() ) ),
class HashtableReferenceCache : public ReferenceCache, public ModuleObserver
{
-typedef HashedCache<CopiedString, ModelResource, PathHash, PathEqual> ModelReferences;
+typedef HashedCache<std::string, ModelResource, PathHash, PathEqual> ModelReferences;
ModelReferences m_references;
std::size_t m_unrealised;
Resource* capture( const char* path ){
//globalOutputStream() << "capture: \"" << path << "\"\n";
- return m_references.capture( CopiedString( path ) ).get();
+ return m_references.capture( std::string( path ) ).get();
}
void release( const char* path ){
- m_references.release( CopiedString( path ) );
+ m_references.release( std::string( path ) );
//globalOutputStream() << "release: \"" << path << "\"\n";
}
}
m_observers.detach( observer );
}
-void realise( const CopiedString& name ){
+void realise( const std::string& name ){
construct( name.c_str() );
if ( m_used != 0 && m_shader != 0 ) {
explicit CreateOpenGLShader( OpenGLShaderCache* cache = 0 )
: m_cache( cache ){
}
-OpenGLShader* construct( const CopiedString& name ){
+OpenGLShader* construct( const std::string& name ){
OpenGLShader* shader = new OpenGLShader;
if ( m_cache->realised() ) {
shader->realise( name );
}
};
-typedef HashedCache<CopiedString, OpenGLShader, HashString, std::equal_to<CopiedString>, CreateOpenGLShader> Shaders;
+typedef HashedCache<std::string, OpenGLShader, HashString, std::equal_to<std::string>, CreateOpenGLShader> Shaders;
Shaders m_shaders;
std::size_t m_unrealised;
class OpenGLStateMap : public OpenGLStateLibrary
{
-typedef std::map<CopiedString, OpenGLState> States;
+typedef std::map<std::string, OpenGLState> States;
States m_states;
public:
~OpenGLStateMap(){
class RadiantModuleServer : public ModuleServer
{
-typedef std::pair<CopiedString, int> ModuleType;
-typedef std::pair<ModuleType, CopiedString> ModuleKey;
+typedef std::pair<std::string, int> ModuleType;
+typedef std::pair<ModuleType, std::string> ModuleKey;
typedef std::map<ModuleKey, Module*> Modules_;
Modules_ m_modules;
bool m_error;
namespace
{
-CopiedString g_selectedShader;
+std::string g_selectedShader;
TextureProjection g_selectedTexdef;
ContentsFlagsValue g_selectedFlags;
size_t g_selectedShaderSize[2];
g_selectedTexdef.m_brushprimit_texdef.coords[0][2] = float_mod( g_selectedTexdef.m_brushprimit_texdef.coords[0][2], (float)g_selectedShaderSize[0] );
g_selectedTexdef.m_brushprimit_texdef.coords[1][2] = float_mod( g_selectedTexdef.m_brushprimit_texdef.coords[1][2], (float)g_selectedShaderSize[1] );
- CopiedString name;
+ std::string name;
Scene_BrushGetShader_Component_Selected( GlobalSceneGraph(), name );
if ( string_not_empty( name.c_str() ) ) {
SurfaceInspector_SetSelectedShader( name.c_str() );
Scene_BrushGetTexdef_Selected( GlobalSceneGraph(), projection );
SurfaceInspector_SetSelectedTexdef( projection );
- CopiedString name;
+ std::string name;
Scene_BrushGetShader_Selected( GlobalSceneGraph(), name );
if ( string_empty( name.c_str() ) ) {
Scene_PatchGetShader_Selected( GlobalSceneGraph(), name );
}
-void Face_getTexture( Face& face, CopiedString& shader, TextureProjection& projection, ContentsFlagsValue& flags ){
+void Face_getTexture( Face& face, std::string& shader, TextureProjection& projection, ContentsFlagsValue& flags ){
shader = face.GetShader();
face.GetTexdef( projection );
flags = face.getShader().m_flags;
}
-typedef Function4<Face&, CopiedString&, TextureProjection&, ContentsFlagsValue&, void, Face_getTexture> FaceGetTexture;
+typedef Function4<Face&, std::string&, TextureProjection&, ContentsFlagsValue&, void, Face_getTexture> FaceGetTexture;
void Face_setTexture( Face& face, const char* shader, const TextureProjection& projection, const ContentsFlagsValue& flags ){
face.SetShader( shader );
typedef Function4<Face&, const char*, const TextureProjection&, const ContentsFlagsValue&, void, Face_setTexture> FaceSetTexture;
-void Patch_getTexture( Patch& patch, CopiedString& shader, TextureProjection& projection, ContentsFlagsValue& flags ){
+void Patch_getTexture( Patch& patch, std::string& shader, TextureProjection& projection, ContentsFlagsValue& flags ){
shader = patch.GetShader();
projection = TextureProjection( texdef_t(), brushprimit_texdef_t(), Vector3( 0, 0, 0 ), Vector3( 0, 0, 0 ) );
flags = ContentsFlagsValue( 0, 0, 0, false );
}
-typedef Function4<Patch&, CopiedString&, TextureProjection&, ContentsFlagsValue&, void, Patch_getTexture> PatchGetTexture;
+typedef Function4<Patch&, std::string&, TextureProjection&, ContentsFlagsValue&, void, Patch_getTexture> PatchGetTexture;
void Patch_setTexture( Patch& patch, const char* shader, const TextureProjection& projection, const ContentsFlagsValue& flags ){
patch.SetShader( shader );
typedef Function4<Patch&, const char*, const TextureProjection&, const ContentsFlagsValue&, void, Patch_setTexture> PatchSetTexture;
-typedef Callback3<CopiedString&, TextureProjection&, ContentsFlagsValue&> GetTextureCallback;
+typedef Callback3<std::string&, TextureProjection&, ContentsFlagsValue&> GetTextureCallback;
typedef Callback3<const char*, const TextureProjection&, const ContentsFlagsValue&> SetTextureCallback;
struct Texturable
return texturable;
}
-bool Scene_getClosestTexture( scene::Graph& graph, SelectionTest& test, CopiedString& shader, TextureProjection& projection, ContentsFlagsValue& flags ){
+bool Scene_getClosestTexture( scene::Graph& graph, SelectionTest& test, std::string& shader, TextureProjection& projection, ContentsFlagsValue& flags ){
Texturable texturable = Scene_getClosestTexturable( graph, test );
if ( texturable.getTexture != GetTextureCallback() ) {
texturable.getTexture( shader, projection, flags );
const char* TextureBrowser_GetSelectedShader( TextureBrowser& textureBrowser );
void Scene_copyClosestTexture( SelectionTest& test ){
- CopiedString shader;
+ std::string shader;
if ( Scene_getClosestTexture( GlobalSceneGraph(), test, shader, g_faceTextureClipboard.m_projection, g_faceTextureClipboard.m_flags ) ) {
TextureBrowser_SetSelectedShader( g_TextureBrowser, shader.c_str() );
}
{
public:
TestHashtable(){
- HashTable<CopiedString, CopiedString, HashStringNoCase, StringEqualNoCase> strings;
+ HashTable<std::string, std::string, HashStringNoCase, StringEqualNoCase> strings;
strings["Monkey"] = "bleh";
strings["MonkeY"] = "blah";
}
#endif
-typedef std::pair<LoadImageCallback, CopiedString> TextureKey;
+typedef std::pair<LoadImageCallback, std::string> TextureKey;
void qtexture_realise( qtexture_t& texture, const TextureKey& key ){
texture.texture_number = 0;
return string_equal_n( string, start.first, start.last - start.first );
}
-typedef std::set<CopiedString> TextureGroups;
+typedef std::set<std::string> TextureGroups;
void TextureGroups_addWad( TextureGroups& groups, const char* archive ){
if ( extension_equal( path_get_extension( archive ), "wad" ) ) {
#if 1
groups.insert( archive );
#else
- CopiedString archiveBaseName( path_get_filename_start( archive ), path_get_filename_base_end( archive ) );
+ std::string archiveBaseName( path_get_filename_start( archive ), path_get_filename_base_end( archive ) );
groups.insert( archiveBaseName );
#endif
}
if ( texture != shaderName ) {
const char* last = path_remove_directory( texture );
if ( !string_empty( last ) ) {
- groups.insert( CopiedString( StringRange( texture, --last ) ) );
+ groups.insert( std::string( StringRange( texture, --last ) ) );
}
}
}
int originy;
int m_nTotalHeight;
-CopiedString shader;
+std::string shader;
GtkWindow* m_parent;
GtkWidget* m_gl_widget;
GtkWidget* m_search_button;
GtkWidget* m_shader_info_item;
-std::set<CopiedString> m_all_tags;
+std::set<std::string> m_all_tags;
GtkListStore* m_all_tags_list;
-std::vector<CopiedString> m_copied_tags;
-std::set<CopiedString> m_found_shaders;
+std::vector<std::string> m_copied_tags;
+std::set<std::string> m_found_shaders;
ToggleItem m_hideunused_item;
ToggleItem m_showshaders_item;
// disable the menu item "shader info" if no shader was selected
IShader* ishader = QERApp_Shader_ForName( shader );
- CopiedString filename = ishader->getShaderFileName();
+ std::string filename = ishader->getShaderFileName();
if ( filename.empty() ) {
if ( textureBrowser.m_shader_info_item != NULL ) {
}
-CopiedString g_TextureBrowser_currentDirectory;
+std::string g_TextureBrowser_currentDirectory;
/*
============================================================================
}
bool TextureSearch_IsShown( const char* name ){
- std::set<CopiedString>::iterator iter;
+ std::set<std::string>::iterator iter;
iter = GlobalTextureBrowser().m_found_shaders.find( name );
}
}
-CopiedString g_notex;
-CopiedString g_shadernotex;
+std::string g_notex;
+std::string g_shadernotex;
// if texture_showinuse jump over non in-use textures
bool Texture_IsShown( IShader* shader, bool show_shaders, bool hideUnused ){
}
if ( g_TextureBrowser_currentDirectory == "Untagged" ) {
- std::set<CopiedString>::iterator iter;
+ std::set<std::string>::iterator iter;
iter = GlobalTextureBrowser().m_found_shaders.find( shader->getName() );
{
public:
void visit( const char* name ){
- IShader* shader = QERApp_Shader_ForName( CopiedString( StringRange( name, path_get_filename_base_end( name ) ) ).c_str() );
+ IShader* shader = QERApp_Shader_ForName( std::string( StringRange( name, path_get_filename_base_end( name ) ) ).c_str() );
shader->DecRef();
}
};
gtk_list_store_clear( store );
- std::vector<CopiedString> assigned_tags;
+ std::vector<std::string> assigned_tags;
TagBuilder.GetShaderTags( shader, assigned_tags );
for ( size_t i = 0; i < assigned_tags.size(); i++ )
void BuildStoreAvailableTags( GtkListStore* storeAvailable,
GtkListStore* storeAssigned,
- const std::set<CopiedString>& allTags,
+ const std::set<std::string>& allTags,
TextureBrowser* textureBrowser ){
GtkTreeIter iterAssigned;
GtkTreeIter iterAvailable;
- std::set<CopiedString>::const_iterator iterAll;
+ std::set<std::string>::const_iterator iterAll;
gchar* tag_assigned;
gtk_list_store_clear( storeAvailable );
&& next != groups.end()
&& string_equal_start( ( *next ).c_str(), dirRoot ) ) {
gtk_tree_store_append( store, &iter, NULL );
- gtk_tree_store_set( store, &iter, 0, CopiedString( StringRange( dirName, firstUnderscore ) ).c_str(), -1 );
+ gtk_tree_store_set( store, &iter, 0, std::string( StringRange( dirName, firstUnderscore ) ).c_str(), -1 );
// keep going...
while ( i != groups.end() && string_equal_start( ( *i ).c_str(), dirRoot ) )
TextureGroups groups = TextureGroups_constructTreeView();
GtkTreeStore* store = gtk_tree_store_new( 1, G_TYPE_STRING );
TextureGroups_constructTreeModel( groups, store );
- std::set<CopiedString>::iterator iter;
+ std::set<std::string>::iterator iter;
GtkTreeModel* model = GTK_TREE_MODEL( store );
if ( !TagBuilder.CheckShaderTag( g_TextureBrowser.shader.c_str() ) ) {
// create a custom shader/texture entry
IShader* ishader = QERApp_Shader_ForName( g_TextureBrowser.shader.c_str() );
- CopiedString filename = ishader->getShaderFileName();
+ std::string filename = ishader->getShaderFileName();
if ( filename.empty() ) {
// it's a texture
GtkTreeIter treeIter;
gtk_list_store_clear( g_TextureBrowser.m_all_tags_list );
- std::set<CopiedString>::iterator iter;
+ std::set<std::string>::iterator iter;
for ( iter = g_TextureBrowser.m_all_tags.begin(); iter != g_TextureBrowser.m_all_tags.end(); ++iter )
{
globalOutputStream() << "Found " << (unsigned int)shaders_found << " textures and shaders with " << tags_searched << "\n";
ScopeDisableScreenUpdates disableScreenUpdates( "Searching...", "Loading Textures" );
- std::set<CopiedString>::iterator iter;
+ std::set<std::string>::iterator iter;
for ( iter = g_TextureBrowser.m_found_shaders.begin(); iter != g_TextureBrowser.m_found_shaders.end(); iter++ )
{
void TextureBrowser_checkTagFile(){
const char SHADERTAG_FILE[] = "shadertags.xml";
- CopiedString default_filename, rc_filename;
+ std::string default_filename, rc_filename;
StringOutputStream stream( 256 );
stream << LocalRcPath_get();
}
void TextureBrowser_addTag(){
- CopiedString tag;
+ std::string tag;
EMessageBoxReturn result = DoShaderTagDlg( &tag, "Add shader tag" );
gtk_tree_selection_selected_foreach( selection, GtkTreeSelectionForeachFunc( TextureBrowser_selectionHelper ), &selected );
if ( g_slist_length( selected ) == 1 ) { // we only rename a single tag
- CopiedString newTag;
+ std::string newTag;
EMessageBoxReturn result = DoShaderTagDlg( &newTag, "Rename shader tag" );
if ( result == eIDOK && !newTag.empty() ) {
TagBuilder.RenameShaderTag( oldTag, newTag.c_str() );
- g_TextureBrowser.m_all_tags.erase( (CopiedString)oldTag );
+ g_TextureBrowser.m_all_tags.erase( (std::string)oldTag );
g_TextureBrowser.m_all_tags.insert( newTag );
BuildStoreAssignedTags( g_TextureBrowser.m_assigned_store, g_TextureBrowser.shader.c_str(), &g_TextureBrowser );
}
TagBuilder.DeleteTag( tagSelected );
- g_TextureBrowser.m_all_tags.erase( (CopiedString)tagSelected );
+ g_TextureBrowser.m_all_tags.erase( (std::string)tagSelected );
BuildStoreAssignedTags( g_TextureBrowser.m_assigned_store, g_TextureBrowser.shader.c_str(), &g_TextureBrowser );
BuildStoreAvailableTags( g_TextureBrowser.m_available_store, g_TextureBrowser.m_assigned_store, g_TextureBrowser.m_all_tags, &g_TextureBrowser );
void TextureBrowser_pasteTag(){
IShader* ishader = QERApp_Shader_ForName( g_TextureBrowser.shader.c_str() );
- CopiedString shader = g_TextureBrowser.shader.c_str();
+ std::string shader = g_TextureBrowser.shader.c_str();
if ( !TagBuilder.CheckShaderTag( shader.c_str() ) ) {
- CopiedString shaderFile = ishader->getShaderFileName();
+ std::string shaderFile = ishader->getShaderFileName();
if ( shaderFile.empty() ) {
// it's a texture
TagBuilder.AddShaderNode( shader.c_str(), CUSTOM, TEXTURE );
if ( result == eIDYES ) {
g_TextureBrowser.m_found_shaders.clear();
TagBuilder.GetUntagged( g_TextureBrowser.m_found_shaders );
- std::set<CopiedString>::iterator iter;
+ std::set<std::string>::iterator iter;
ScopeDisableScreenUpdates disableScreenUpdates( "Searching untagged textures...", "Loading Textures" );
class GraphTreeNode
{
-typedef std::map<std::pair<CopiedString, scene::Node*>, GraphTreeNode*> ChildNodes;
+typedef std::map<std::pair<std::string, scene::Node*>, GraphTreeNode*> ChildNodes;
ChildNodes m_childnodes;
public:
Reference<scene::Instance> m_instance;
struct Operation
{
Snapshot m_snapshot;
- CopiedString m_command;
+ std::string m_command;
Operation( const char* command )
: m_command( command ){
class EntityClassMenuInserter : public EntityClassVisitor
{
-typedef std::pair<GtkMenu*, CopiedString> MenuPair;
+typedef std::pair<GtkMenu*, std::string> MenuPair;
typedef std::vector<MenuPair> MenuStack;
MenuStack m_stack;
-CopiedString m_previous;
+std::string m_previous;
public:
EntityClassMenuInserter( GtkMenu* menu ){
m_stack.reserve( 2 );
}
m_previous = e->name();
}
-void pushMenu( const CopiedString& name ){
+void pushMenu( const std::string& name ){
GtkMenuItem* item = GTK_MENU_ITEM( gtk_menu_item_new_with_label( name.c_str() ) );
gtk_widget_show( GTK_WIDGET( item ) );
container_add_widget( GTK_CONTAINER( m_stack.back().first ), GTK_WIDGET( item ) );
if ( m_stack.size() == 2 ) {
popMenu();
}
- pushMenu( CopiedString( StringRange( name, underscore ) ) );
+ pushMenu( std::string( StringRange( name, underscore ) ) );
}
else if ( m_stack.size() == 2 ) {
popMenu();