From 37c7ff934c78a81175b669bc1f6bfd1d846066e6 Mon Sep 17 00:00:00 2001 From: Garux Date: Mon, 6 Oct 2025 22:52:30 +0500 Subject: [PATCH] remove makeQuoted, use Quoted directly --- contrib/bobtoolz/DTreePlanter.h | 2 +- include/modulesystem.h | 8 ++++---- libs/gtkutil/accelerator.cpp | 16 ++++++++-------- libs/gtkutil/filechooser.cpp | 4 ++-- libs/gtkutil/glfont.cpp | 2 +- libs/modulesystem/modulesmap.h | 2 +- libs/scenelib.h | 4 ++-- libs/stream/textstream.h | 5 ----- plugins/archivepak/archive.cpp | 2 +- plugins/archivezip/archive.cpp | 8 ++++---- plugins/entity/skincache.cpp | 4 ++-- plugins/mapq3/plugin.cpp | 4 ++-- plugins/shaders/shaders.cpp | 16 ++++++++-------- plugins/vfspk3/vfs.cpp | 4 ++-- radiant/brushmanip.cpp | 2 +- radiant/build.cpp | 14 +++++++------- radiant/colors.cpp | 10 +++++----- radiant/commands.cpp | 20 ++++++++++---------- radiant/eclass.cpp | 2 +- radiant/eclass_doom3.cpp | 16 ++++++++-------- radiant/eclass_fgd.cpp | 18 +++++++++--------- radiant/eclass_xml.cpp | 4 ++-- radiant/entity.cpp | 2 +- radiant/entityinspector.cpp | 2 +- radiant/environment.cpp | 2 +- radiant/gtkdlgs.cpp | 4 ++-- radiant/mainframe.cpp | 4 ++-- radiant/map.cpp | 20 ++++++++++---------- radiant/preferences.cpp | 8 ++++---- radiant/preferences.h | 2 +- radiant/qe3.cpp | 4 ++-- radiant/referencecache.cpp | 12 ++++++------ radiant/renderstate.cpp | 12 ++++++------ radiant/server.cpp | 4 ++-- radiant/textures.cpp | 4 ++-- radiant/texwindow.cpp | 4 ++-- radiant/watchbsp.cpp | 2 +- 37 files changed, 124 insertions(+), 129 deletions(-) diff --git a/contrib/bobtoolz/DTreePlanter.h b/contrib/bobtoolz/DTreePlanter.h index 8ffef4e3..f7766d7b 100644 --- a/contrib/bobtoolz/DTreePlanter.h +++ b/contrib/bobtoolz/DTreePlanter.h @@ -79,7 +79,7 @@ public: } if( string_empty( m_entType ) ) - globalErrorStream() << "bobToolz::TreePlanter parsed no entity name from " << makeQuoted( buffer ) << '\n'; + globalErrorStream() << "bobToolz::TreePlanter parsed no entity name from " << Quoted( buffer ) << '\n'; m_mouseDown = GlobalRadiant().XYWindowMouseDown_connect( makeSignalHandler3( MouseDownCaller(), *this ) ); m_destroyed = GlobalRadiant().XYWindowDestroyed_connect( makeSignalHandler( DestroyedCaller(), *this ) ); diff --git a/include/modulesystem.h b/include/modulesystem.h index f7390f60..ea486b92 100644 --- a/include/modulesystem.h +++ b/include/modulesystem.h @@ -132,7 +132,7 @@ public: m_module = globalModuleServer().findModule( Type::Name, Type::Version, name ); if ( m_module == 0 ) { globalModuleServer().setError( true ); - globalErrorStream() << "ModuleRef::initialise: type=" << makeQuoted( Type::Name ) << " version=" << makeQuoted( Type::Version ) << " name=" << makeQuoted( name ) << " - not found\n"; + globalErrorStream() << "ModuleRef::initialise: type=" << Quoted( Type::Name ) << " version=" << Quoted( Type::Version ) << " name=" << Quoted( name ) << " - not found\n"; } else { @@ -150,7 +150,7 @@ public: } Type* getTable(){ #if defined( _DEBUG ) - ASSERT_MESSAGE( m_table != 0, "ModuleRef::getTable: type=" << makeQuoted( Type::Name ) << " version=" << makeQuoted( Type::Version ) << " - module-reference used without being initialised" ); + ASSERT_MESSAGE( m_table != 0, "ModuleRef::getTable: type=" << Quoted( Type::Name ) << " version=" << Quoted( Type::Version ) << " - module-reference used without being initialised" ); #endif return m_table; } @@ -175,13 +175,13 @@ public: m_module = globalModuleServer().findModule( Type::Name, Type::Version, name ); if ( m_module == 0 ) { globalModuleServer().setError( true ); - globalErrorStream() << "SingletonModuleRef::initialise: type=" << makeQuoted( Type::Name ) << " version=" << makeQuoted( Type::Version ) << " name=" << makeQuoted( name ) << " - not found\n"; + globalErrorStream() << "SingletonModuleRef::initialise: type=" << Quoted( Type::Name ) << " version=" << Quoted( Type::Version ) << " name=" << Quoted( name ) << " - not found\n"; } } Type* getTable(){ #if defined( _DEBUG ) - ASSERT_MESSAGE( m_table != 0, "SingletonModuleRef::getTable: type=" << makeQuoted( Type::Name ) << " version=" << makeQuoted( Type::Version ) << " - module-reference used without being initialised" ); + ASSERT_MESSAGE( m_table != 0, "SingletonModuleRef::getTable: type=" << Quoted( Type::Name ) << " version=" << Quoted( Type::Version ) << " - module-reference used without being initialised" ); #endif return m_table; } diff --git a/libs/gtkutil/accelerator.cpp b/libs/gtkutil/accelerator.cpp index 1c8cc50d..b97de4f8 100644 --- a/libs/gtkutil/accelerator.cpp +++ b/libs/gtkutil/accelerator.cpp @@ -172,28 +172,28 @@ void GlobalPressedKeys_connect( QWidget* window ){ void keydown_accelerators_add( QKeySequence accelerator, const Callback& callback ){ - //globalOutputStream() << "keydown_accelerators_add: " << makeQuoted( accelerator ) << '\n'; + //globalOutputStream() << "keydown_accelerators_add: " << Quoted( accelerator ) << '\n'; if ( !accelerator_map_insert( g_keydown_accelerators, accelerator, callback ) ) { - globalErrorStream() << "keydown_accelerators_add: already exists: " << makeQuoted( accelerator ) << '\n'; + globalErrorStream() << "keydown_accelerators_add: already exists: " << Quoted( accelerator ) << '\n'; } } void keydown_accelerators_remove( QKeySequence accelerator ){ - //globalOutputStream() << "keydown_accelerators_remove: " << makeQuoted( accelerator ) << '\n'; + //globalOutputStream() << "keydown_accelerators_remove: " << Quoted( accelerator ) << '\n'; if ( !accelerator_map_erase( g_keydown_accelerators, accelerator ) ) { - globalErrorStream() << "keydown_accelerators_remove: not found: " << makeQuoted( accelerator ) << '\n'; + globalErrorStream() << "keydown_accelerators_remove: not found: " << Quoted( accelerator ) << '\n'; } } void keyup_accelerators_add( QKeySequence accelerator, const Callback& callback ){ - //globalOutputStream() << "keyup_accelerators_add: " << makeQuoted( accelerator ) << '\n'; + //globalOutputStream() << "keyup_accelerators_add: " << Quoted( accelerator ) << '\n'; if ( !accelerator_map_insert( g_keyup_accelerators, accelerator, callback ) ) { - globalErrorStream() << "keyup_accelerators_add: already exists: " << makeQuoted( accelerator ) << '\n'; + globalErrorStream() << "keyup_accelerators_add: already exists: " << Quoted( accelerator ) << '\n'; } } void keyup_accelerators_remove( QKeySequence accelerator ){ - //globalOutputStream() << "keyup_accelerators_remove: " << makeQuoted( accelerator ) << '\n'; + //globalOutputStream() << "keyup_accelerators_remove: " << Quoted( accelerator ) << '\n'; if ( !accelerator_map_erase( g_keyup_accelerators, accelerator ) ) { - globalErrorStream() << "keyup_accelerators_remove: not found: " << makeQuoted( accelerator ) << '\n'; + globalErrorStream() << "keyup_accelerators_remove: not found: " << Quoted( accelerator ) << '\n'; } } diff --git a/libs/gtkutil/filechooser.cpp b/libs/gtkutil/filechooser.cpp index 501e22db..7c108fe1 100644 --- a/libs/gtkutil/filechooser.cpp +++ b/libs/gtkutil/filechooser.cpp @@ -126,7 +126,7 @@ const char* file_dialog( QWidget* parent, bool open, const char* title, const ch const GTKMasks masks( typelist ); if ( path != 0 && !string_empty( path ) ) { - ASSERT_MESSAGE( path_is_absolute( path ), "file_dialog_show: path not absolute: " << makeQuoted( path ) ); + ASSERT_MESSAGE( path_is_absolute( path ), "file_dialog_show: path not absolute: " << Quoted( path ) ); } // we should add all important paths as shortcut folder... @@ -165,7 +165,7 @@ const char* file_dialog( QWidget* parent, bool open, const char* title, const ch if( !string_empty( extension ) ){ // validate it const auto check = [extension]( const CopiedString& filter ){ return extension_equal( extension, path_get_extension( filter.c_str() ) ); }; if( !std::ranges::any_of( masks.m_filters, check ) ) { - qt_MessageBox( parent, StringStream<64>( makeQuoted( extension ), " is unsupported file type for requested operation\n" ), extension, EMessageBoxType::Error ); + qt_MessageBox( parent, StringStream<64>( Quoted( extension ), " is unsupported file type for requested operation\n" ), extension, EMessageBoxType::Error ); g_file_dialog_file.clear(); } } diff --git a/libs/gtkutil/glfont.cpp b/libs/gtkutil/glfont.cpp index 1442b1bc..ec4f655f 100644 --- a/libs/gtkutil/glfont.cpp +++ b/libs/gtkutil/glfont.cpp @@ -712,7 +712,7 @@ GLFont *glfont_create( const char* family, int fontSize, const char* appPath ){ else if( !string_empty( family ) ) font.setFamily( family ); } - globalOutputStream() << "Using OpenGL font " << makeQuoted( font.toString().toLatin1().constData() ) << '\n'; + globalOutputStream() << "Using OpenGL font " << Quoted( font.toString().toLatin1().constData() ) << '\n'; QFontMetrics metrics( font ); diff --git a/libs/modulesystem/modulesmap.h b/libs/modulesystem/modulesmap.h index c8864da7..af0455f3 100644 --- a/libs/modulesystem/modulesmap.h +++ b/libs/modulesystem/modulesmap.h @@ -113,7 +113,7 @@ public: } Module* module = globalModuleServer().findModule( Type::Name, Type::Version, name ); if ( module == 0 ) { - globalErrorStream() << "ModulesRef::initialise: type=" << makeQuoted( Type::Name ) << " version=" << makeQuoted( Type::Version ) << " name=" << makeQuoted( name ) << " - not found\n"; + globalErrorStream() << "ModulesRef::initialise: type=" << Quoted( Type::Name ) << " version=" << Quoted( Type::Version ) << " name=" << Quoted( name ) << " - not found\n"; // do not fail on missing image or model plugin, they can be optional if ( !string_equal( Type::Name, "image" ) && !string_equal( Type::Name, "model" ) ){ globalModuleServer().setError( true ); diff --git a/libs/scenelib.h b/libs/scenelib.h index ade52b1c..1993bd0d 100644 --- a/libs/scenelib.h +++ b/libs/scenelib.h @@ -103,7 +103,7 @@ public: typedef MemberCaller, void(), &NodeType::initialise> InitialiseCaller; TypeId getTypeId(){ #if defined( _DEBUG ) - ASSERT_MESSAGE( m_typeId != NODETYPEID_NONE, "node-type " << makeQuoted( Type::Name ) << " used before being initialised" ); + ASSERT_MESSAGE( m_typeId != NODETYPEID_NONE, "node-type " << Quoted( Type::Name ) << " used before being initialised" ); #endif return m_typeId; } @@ -441,7 +441,7 @@ public: typedef MemberCaller, void(), &InstanceType::initialise> InitialiseCaller; TypeId getTypeId(){ #if defined( _DEBUG ) - ASSERT_MESSAGE( m_typeId != INSTANCETYPEID_NONE, "instance-type " << makeQuoted( Type::Name ) << " used before being initialised" ); + ASSERT_MESSAGE( m_typeId != INSTANCETYPEID_NONE, "instance-type " << Quoted( Type::Name ) << " used before being initialised" ); #endif return m_typeId; } diff --git a/libs/stream/textstream.h b/libs/stream/textstream.h index 94a4dd24..04121f18 100644 --- a/libs/stream/textstream.h +++ b/libs/stream/textstream.h @@ -298,11 +298,6 @@ public: } }; -template -inline Quoted makeQuoted( const Type& type ){ - return Quoted( type ); -} - /// \brief Writes any type to \p ostream with a quotation mark character before and after it. template inline TextOutputStreamType& ostream_write( TextOutputStreamType& ostream, const Quoted& quoted ){ diff --git a/plugins/archivepak/archive.cpp b/plugins/archivepak/archive.cpp index cbf5516c..bb561534 100644 --- a/plugins/archivepak/archive.cpp +++ b/plugins/archivepak/archive.cpp @@ -92,7 +92,7 @@ public: PakFileSystem::entry_type& file = m_filesystem[entry.filename]; if ( !file.is_directory() ) { - globalWarningStream() << "Warning: pak archive " << makeQuoted( m_name ) << " contains duplicated file: " << makeQuoted( entry.filename ) << '\n'; + globalWarningStream() << "Warning: pak archive " << Quoted( m_name ) << " contains duplicated file: " << Quoted( entry.filename ) << '\n'; } else { diff --git a/plugins/archivezip/archive.cpp b/plugins/archivezip/archive.cpp index 5efb9f3c..8ad3e407 100644 --- a/plugins/archivezip/archive.cpp +++ b/plugins/archivezip/archive.cpp @@ -161,7 +161,7 @@ class ZipArchive final : public Archive { ZipFileSystem::entry_type& file = m_filesystem[filename.data()]; if ( !file.is_directory() ) { - globalWarningStream() << "Warning: zip archive " << makeQuoted( m_name ) << " contains duplicated file: " << makeQuoted( filename.data() ) << '\n'; + globalWarningStream() << "Warning: zip archive " << Quoted( m_name ) << " contains duplicated file: " << Quoted( filename.data() ) << '\n'; } else { @@ -198,7 +198,7 @@ public: : m_name( name ), m_istream( name ){ if ( !m_istream.failed() ) { if ( !read_pkzip() ) { - globalErrorStream() << "ERROR: invalid zip-file " << makeQuoted( name ) << '\n'; + globalErrorStream() << "ERROR: invalid zip-file " << Quoted( name ) << '\n'; } } } @@ -225,7 +225,7 @@ public: zip_file_header file_header; istream_read_zip_file_header( m_istream, file_header ); if ( file_header.z_magic != zip_file_header_magic ) { - globalErrorStream() << "error reading zip file " << makeQuoted( m_name ); + globalErrorStream() << "error reading zip file " << Quoted( m_name ); return 0; } @@ -248,7 +248,7 @@ public: zip_file_header file_header; istream_read_zip_file_header( m_istream, file_header ); if ( file_header.z_magic != zip_file_header_magic ) { - globalErrorStream() << "error reading zip file " << makeQuoted( m_name ); + globalErrorStream() << "error reading zip file " << Quoted( m_name ); return 0; } diff --git a/plugins/entity/skincache.cpp b/plugins/entity/skincache.cpp index 914a76e9..a1c1a44b 100644 --- a/plugins/entity/skincache.cpp +++ b/plugins/entity/skincache.cpp @@ -138,7 +138,7 @@ public: void parseFile( const char* name ){ ArchiveTextFile* file = GlobalFileSystem().openTextFile( StringStream<64>( "skins/", name ) ); if ( file != 0 ) { - globalOutputStream() << "parsing skins from " << makeQuoted( name ) << '\n'; + globalOutputStream() << "parsing skins from " << Quoted( name ) << '\n'; { Tokeniser& tokeniser = GlobalScriptLibrary().m_pfnNewSimpleTokeniser( file->getInputStream() ); parseTokens( tokeniser ); @@ -148,7 +148,7 @@ public: } else { - globalErrorStream() << "failed to open " << makeQuoted( name ) << '\n'; + globalErrorStream() << "failed to open " << Quoted( name ) << '\n'; } } diff --git a/plugins/mapq3/plugin.cpp b/plugins/mapq3/plugin.cpp index d6371f10..c885bc36 100644 --- a/plugins/mapq3/plugin.cpp +++ b/plugins/mapq3/plugin.cpp @@ -508,7 +508,7 @@ MapQ2Module g_MapQ2Module; #define PARSE_ERROR "error parsing VMF" inline void parseToken( Tokeniser& tokeniser, const char* token ){ - ASSERT_MESSAGE( Tokeniser_parseToken( tokeniser, token ), "error parsing vmf: token not found: " << makeQuoted( token ) ); + ASSERT_MESSAGE( Tokeniser_parseToken( tokeniser, token ), "error parsing vmf: token not found: " << Quoted( token ) ); } @@ -590,7 +590,7 @@ void VMF_parseBlock( Tokeniser& tokeniser, const VMFBlock& block ){ tokeniser.nextLine(); if ( string_equal( value, "{" ) ) { VMFBlock::const_iterator i = VMFBlock_find( block, tmp.c_str() ); - ASSERT_MESSAGE( i != block.end(), "error parsing vmf block " << makeQuoted( block.name() ) << ": unknown block: " << makeQuoted( tmp ) ); + ASSERT_MESSAGE( i != block.end(), "error parsing vmf block " << Quoted( block.name() ) << ": unknown block: " << Quoted( tmp ) ); if ( string_equal( tmp.c_str(), "solid" ) ) { ++g_vmf_brushes; } diff --git a/plugins/shaders/shaders.cpp b/plugins/shaders/shaders.cpp index 5135010b..b016543e 100644 --- a/plugins/shaders/shaders.cpp +++ b/plugins/shaders/shaders.cpp @@ -455,7 +455,7 @@ bool parseShaderParameters( Tokeniser& tokeniser, ShaderParameters& params ){ bool ShaderTemplate::parseTemplate( Tokeniser& tokeniser ){ m_Name = tokeniser.getToken(); if ( !parseShaderParameters( tokeniser, m_params ) ) { - globalErrorStream() << "shader template: " << makeQuoted( m_Name ) << ": parameter parse failed\n"; + globalErrorStream() << "shader template: " << Quoted( m_Name ) << ": parameter parse failed\n"; return false; } @@ -703,18 +703,18 @@ bool parseTemplateInstance( Tokeniser& tokeniser, const char* filename ){ const char* templateName = tokeniser.getToken(); ShaderTemplate* shaderTemplate = findTemplate( templateName ); if ( shaderTemplate == 0 ) { - globalErrorStream() << "shader instance: " << makeQuoted( name ) << ": shader template not found: " << makeQuoted( templateName ) << '\n'; + globalErrorStream() << "shader instance: " << Quoted( name ) << ": shader template not found: " << Quoted( templateName ) << '\n'; } ShaderArguments args; if ( !parseShaderParameters( tokeniser, args ) ) { - globalErrorStream() << "shader instance: " << makeQuoted( name ) << ": argument parse failed\n"; + globalErrorStream() << "shader instance: " << Quoted( name ) << ": argument parse failed\n"; return false; } if ( shaderTemplate != 0 ) { if ( !g_shaderDefinitions.insert( ShaderDefinitionMap::value_type( name, ShaderDefinition( shaderTemplate, args, filename ) ) ).second ) { - globalErrorStream() << "shader instance: " << makeQuoted( name ) << ": already exists, second definition ignored\n"; + globalErrorStream() << "shader instance: " << Quoted( name ) << ": already exists, second definition ignored\n"; } } return true; @@ -777,7 +777,7 @@ float evaluateFloat( const ShaderValue& value, const ShaderParameters& params, c const char* result = evaluateShaderValue( value.c_str(), params, args ); float f; if ( !string_parse_float( result, f ) ) { - globalErrorStream() << "parsing float value failed: " << makeQuoted( result ) << '\n'; + globalErrorStream() << "parsing float value failed: " << Quoted( result ) << '\n'; return 1.f; } return f; @@ -820,7 +820,7 @@ BlendFactor evaluateBlendFactor( const ShaderValue& value, const ShaderParameter return BLEND_SRC_ALPHA_SATURATE; } - globalErrorStream() << "parsing blend-factor value failed: " << makeQuoted( result ) << '\n'; + globalErrorStream() << "parsing blend-factor value failed: " << Quoted( result ) << '\n'; return BLEND_ZERO; } @@ -1016,7 +1016,7 @@ public: } else { - globalErrorStream() << "parsing blend value failed: " << makeQuoted( blend ) << '\n'; + globalErrorStream() << "parsing blend value failed: " << Quoted( blend ) << '\n'; } } } @@ -1420,7 +1420,7 @@ void parseGuideFile( Tokeniser& tokeniser, const char* filename ){ ShaderTemplatePointer shaderTemplate( new ShaderTemplate ); shaderTemplate->parseTemplate( tokeniser ); if ( !g_shaderTemplates.insert( ShaderTemplateMap::value_type( shaderTemplate->getName(), shaderTemplate ) ).second ) { - globalErrorStream() << "guide " << makeQuoted( shaderTemplate->getName() ) << ": already defined, second definition ignored\n"; + globalErrorStream() << "guide " << Quoted( shaderTemplate->getName() ) << ": already defined, second definition ignored\n"; } } else if ( string_equal( token, "inlineGuide" ) ) { diff --git a/plugins/vfspk3/vfs.cpp b/plugins/vfspk3/vfs.cpp index 41fb21e8..d2a98b5f 100644 --- a/plugins/vfspk3/vfs.cpp +++ b/plugins/vfspk3/vfs.cpp @@ -428,7 +428,7 @@ int GetFileCount( const char *filename, int flag ){ } ArchiveFile* OpenFile( const char* filename ){ - ASSERT_MESSAGE( strchr( filename, '\\' ) == 0, "path contains invalid separator '\\': " << makeQuoted( filename ) ); + ASSERT_MESSAGE( strchr( filename, '\\' ) == 0, "path contains invalid separator '\\': " << Quoted( filename ) ); for ( archive_entry_t& arch : g_archives ) { ArchiveFile* file = arch.archive->openFile( filename ); @@ -441,7 +441,7 @@ ArchiveFile* OpenFile( const char* filename ){ } ArchiveTextFile* OpenTextFile( const char* filename ){ - ASSERT_MESSAGE( strchr( filename, '\\' ) == 0, "path contains invalid separator '\\': " << makeQuoted( filename ) ); + ASSERT_MESSAGE( strchr( filename, '\\' ) == 0, "path contains invalid separator '\\': " << Quoted( filename ) ); for ( archive_entry_t& arch : g_archives ) { ArchiveTextFile* file = arch.archive->openTextFile( filename ); diff --git a/radiant/brushmanip.cpp b/radiant/brushmanip.cpp index 5a6a64c0..b97b753f 100644 --- a/radiant/brushmanip.cpp +++ b/radiant/brushmanip.cpp @@ -467,7 +467,7 @@ void ConstructRegionBrushes( scene::Node* brushes[6], const Vector3& region_mins ? texdef_name_default() : texdef_name_valid( g_regionBoxShader.c_str() ) ? g_regionBoxShader.c_str() - : ( globalWarningStream() << "g_regionBoxShader " << makeQuoted( g_regionBoxShader ) << " !texdef_name_valid()\n" + : ( globalWarningStream() << "g_regionBoxShader " << Quoted( g_regionBoxShader ) << " !texdef_name_valid()\n" , texdef_name_default() ); { diff --git a/radiant/build.cpp b/radiant/build.cpp index 372502d9..5c6a858c 100644 --- a/radiant/build.cpp +++ b/radiant/build.cpp @@ -46,7 +46,7 @@ const char* build_get_variable( const char* name ){ if ( i != g_build_variables.end() ) { return ( *i ).second.c_str(); } - globalErrorStream() << "undefined build variable: " << makeQuoted( name ) << '\n'; + globalErrorStream() << "undefined build variable: " << Quoted( name ) << '\n'; return ""; } @@ -192,7 +192,7 @@ public: return length; } XMLElementParser& pushElement( const XMLElement& element ) override { - ERROR_MESSAGE( "parse error: invalid element " << makeQuoted( element.name() ) ); + ERROR_MESSAGE( "parse error: invalid element " << Quoted( element.name() ) ); return *this; } void popElement( const char* name ) override { @@ -214,7 +214,7 @@ public: return length; } XMLElementParser& pushElement( const XMLElement& element ) override { - ERROR_MESSAGE( "parse error: invalid element " << makeQuoted( element.name() ) ); + ERROR_MESSAGE( "parse error: invalid element " << Quoted( element.name() ) ); return *this; } void popElement( const char* name ) override { @@ -246,7 +246,7 @@ public: } else { - ERROR_MESSAGE( "parse error: invalid element " << makeQuoted( element.name() ) ); + ERROR_MESSAGE( "parse error: invalid element " << Quoted( element.name() ) ); return *this; } } @@ -421,7 +421,7 @@ public: } else { - //ERROR_MESSAGE( "parse error: invalid element " << makeQuoted( element.name() ) ); + //ERROR_MESSAGE( "parse error: invalid element " << Quoted( element.name() ) ); return *this; } } @@ -443,7 +443,7 @@ bool g_tools_changed = false; } void build_error_undefined_tool( const char* build, const char* tool ){ - globalErrorStream() << "build " << makeQuoted( build ) << " refers to undefined tool " << makeQuoted( tool ) << '\n'; + globalErrorStream() << "build " << Quoted( build ) << " refers to undefined tool " << Quoted( tool ) << '\n'; } void project_verify( Project& project, Tools& tools ){ @@ -533,7 +533,7 @@ bool build_commands_parse( const char* filename ){ return true; } - globalErrorStream() << "failed to parse build menu: " << makeQuoted( filename ) << '\n'; + globalErrorStream() << "failed to parse build menu: " << Quoted( filename ) << '\n'; } return false; } diff --git a/radiant/colors.cpp b/radiant/colors.cpp index 4a5ac5a6..c8f96b15 100644 --- a/radiant/colors.cpp +++ b/radiant/colors.cpp @@ -173,7 +173,7 @@ std::array g_ColoursMenu{ static void load_colors_theme( const char *filepath ){ TextFileInputStream file( filepath ); if( file.failed() ){ - globalErrorStream() << "File " << makeQuoted( filepath ) << " reading failed.\n"; + globalErrorStream() << "File " << Quoted( filepath ) << " reading failed.\n"; return; } @@ -183,20 +183,20 @@ static void load_colors_theme( const char *filepath ){ rapidjson::Document doc; doc.Parse( str.c_str() ); if( doc.HasParseError() ){ - globalErrorStream() << "File " << makeQuoted( filepath ) << " parsing failed.\n"; + globalErrorStream() << "File " << Quoted( filepath ) << " parsing failed.\n"; return; } for( const auto& colour : g_ColoursMenu ){ const auto it = doc.GetObj().FindMember( colour.m_saveName ); if( it == doc.GetObj().MemberEnd() ){ - globalWarningStream() << makeQuoted( colour.m_saveName ) << " not found in file " << makeQuoted( filepath ) << '\n'; + globalWarningStream() << Quoted( colour.m_saveName ) << " not found in file " << Quoted( filepath ) << '\n'; } else if( !it->value.IsArray() ){ - globalWarningStream() << makeQuoted( colour.m_saveName ) << " is not an array in file " << makeQuoted( filepath ) << '\n'; + globalWarningStream() << Quoted( colour.m_saveName ) << " is not an array in file " << Quoted( filepath ) << '\n'; } else if( it->value.GetArray().Size() != 3 ){ - globalWarningStream() << makeQuoted( colour.m_saveName ) << " array.size != 3 in file " << makeQuoted( filepath ) << '\n'; + globalWarningStream() << Quoted( colour.m_saveName ) << " array.size != 3 in file " << Quoted( filepath ) << '\n'; } else{ Vector3 clr( 0 ); diff --git a/radiant/commands.cpp b/radiant/commands.cpp index 5fe33f75..286e6d57 100644 --- a/radiant/commands.cpp +++ b/radiant/commands.cpp @@ -70,12 +70,12 @@ Commands g_commands; void GlobalCommands_insert( const char* name, const Callback& callback, const QKeySequence& accelerator ){ bool added = g_commands.insert( Commands::value_type( name, Command( callback, GlobalShortcuts_insert( name, accelerator ) ) ) ).second; - ASSERT_MESSAGE( added, "command already registered: " << makeQuoted( name ) ); + ASSERT_MESSAGE( added, "command already registered: " << Quoted( name ) ); } const Command& GlobalCommands_find( const char* command ){ Commands::iterator i = g_commands.find( command ); - ASSERT_MESSAGE( i != g_commands.end(), "failed to lookup command " << makeQuoted( command ) ); + ASSERT_MESSAGE( i != g_commands.end(), "failed to lookup command " << Quoted( command ) ); return ( *i ).second; } @@ -86,11 +86,11 @@ Toggles g_toggles; void GlobalToggles_insert( const char* name, const Callback& callback, const BoolExportCallback& exportCallback, const QKeySequence& accelerator ){ bool added = g_toggles.insert( Toggles::value_type( name, Toggle( callback, GlobalShortcuts_insert( name, accelerator ), exportCallback ) ) ).second; - ASSERT_MESSAGE( added, "toggle already registered: " << makeQuoted( name ) ); + ASSERT_MESSAGE( added, "toggle already registered: " << Quoted( name ) ); } const Toggle& GlobalToggles_find( const char* name ){ Toggles::iterator i = g_toggles.find( name ); - ASSERT_MESSAGE( i != g_toggles.end(), "failed to lookup toggle " << makeQuoted( name ) ); + ASSERT_MESSAGE( i != g_toggles.end(), "failed to lookup toggle " << Quoted( name ) ); return ( *i ).second; } @@ -101,11 +101,11 @@ KeyEvents g_keyEvents; void GlobalKeyEvents_insert( const char* name, const Callback& keyDown, const Callback& keyUp, const QKeySequence& accelerator ){ bool added = g_keyEvents.insert( KeyEvents::value_type( name, KeyEvent( GlobalShortcuts_insert( name, accelerator ), keyDown, keyUp ) ) ).second; - ASSERT_MESSAGE( added, "command already registered: " << makeQuoted( name ) ); + ASSERT_MESSAGE( added, "command already registered: " << Quoted( name ) ); } const KeyEvent& GlobalKeyEvents_find( const char* name ){ KeyEvents::iterator i = g_keyEvents.find( name ); - ASSERT_MESSAGE( i != g_keyEvents.end(), "failed to lookup keyEvent " << makeQuoted( name ) ); + ASSERT_MESSAGE( i != g_keyEvents.end(), "failed to lookup keyEvent " << Quoted( name ) ); return ( *i ).second; } @@ -240,7 +240,7 @@ static void accelerator_alter( QTreeWidgetItem *item, const QKeySequence acceler Shortcuts::iterator thisShortcutIterator = g_shortcuts.find( commandName.constData() ); if ( thisShortcutIterator == g_shortcuts.end() ) { - globalErrorStream() << "commandName " << makeQuoted( commandName.constData() ) << " not found in g_shortcuts.\n"; + globalErrorStream() << "commandName " << Quoted( commandName.constData() ) << " not found in g_shortcuts.\n"; return; } @@ -471,7 +471,7 @@ public: } else { - globalWarningStream() << "WARNING: failed to parse user command " << makeQuoted( name ) << ": unknown key " << makeQuoted( *value ) << '\n'; + globalWarningStream() << "WARNING: failed to parse user command " << Quoted( name ) << ": unknown key " << Quoted( *value ) << '\n'; } } } @@ -485,7 +485,7 @@ void LoadCommandMap( const char* path ){ const auto strINI = StringStream( path, "shortcuts.ini" ); if ( IniFile ini; ini.read( strINI ) ) { - globalOutputStream() << "loading custom shortcuts list from " << makeQuoted( strINI ) << '\n'; + globalOutputStream() << "loading custom shortcuts list from " << Quoted( strINI ) << '\n'; const Version version = version_parse( COMMANDS_VERSION ); const Version dataVersion = version_parse( ini.getValue( "Version", "number" ).value_or( "" ) ); @@ -503,6 +503,6 @@ void LoadCommandMap( const char* path ){ } else { - globalWarningStream() << "failed to load custom shortcuts from " << makeQuoted( strINI ) << '\n'; + globalWarningStream() << "failed to load custom shortcuts from " << Quoted( strINI ) << '\n'; } } diff --git a/radiant/eclass.cpp b/radiant/eclass.cpp index 70cc5e46..ff7188ee 100644 --- a/radiant/eclass.cpp +++ b/radiant/eclass.cpp @@ -169,7 +169,7 @@ struct PathLess typedef std::map Paths; void EntityClassQuake3_constructDirectory( const char* directory, const char* extension, Paths& paths ){ - globalOutputStream() << "EntityClass: searching " << makeQuoted( directory ) << " for *." << extension << '\n'; + globalOutputStream() << "EntityClass: searching " << Quoted( directory ) << " for *." << extension << '\n'; Directory_forEach( directory, matchFileExtension( extension, [&]( const char *name ){ paths.insert( Paths::value_type( name, directory ) ); })); diff --git a/radiant/eclass_doom3.cpp b/radiant/eclass_doom3.cpp index 9c283ade..acac175d 100644 --- a/radiant/eclass_doom3.cpp +++ b/radiant/eclass_doom3.cpp @@ -123,7 +123,7 @@ bool EntityClassDoom3_parseUnknown( Tokeniser& tokeniser ){ //const char* name = PARSE_RETURN_FALSE_IF_FAIL( EntityClassDoom3_parseToken( tokeniser ) ); - //globalOutputStream() << "parsing unknown block " << makeQuoted( name ) << '\n'; + //globalOutputStream() << "parsing unknown block " << Quoted( name ) << '\n'; PARSE_RETURN_FALSE_IF_FAIL( EntityClassDoom3_parseToken( tokeniser, "{" ) ); tokeniser.nextLine(); @@ -275,7 +275,7 @@ bool EntityClassDoom3_parseModel( Tokeniser& tokeniser ){ } else { - globalErrorStream() << "unknown model parameter: " << makeQuoted( parameter ) << '\n'; + globalErrorStream() << "unknown model parameter: " << Quoted( parameter ) << '\n'; return false; } tokeniser.nextLine(); @@ -502,16 +502,16 @@ static bool EntityClass_parse( EntityClass& entityClass, Tokeniser& tokeniser ){ else { CopiedString tmp( key ); - //ASSERT_MESSAGE( !string_equal_n( key, "editor_", 7 ), "unsupported editor key: " << makeQuoted( key ) ); + //ASSERT_MESSAGE( !string_equal_n( key, "editor_", 7 ), "unsupported editor key: " << Quoted( key ) ); if ( string_equal_n( key, "editor_", 7 ) ) { - globalErrorStream() << "unsupported editor key " << makeQuoted( key ); + globalErrorStream() << "unsupported editor key " << Quoted( key ); } EntityClassAttribute& attribute = EntityClass_insertAttribute( entityClass, key ).second; attribute.m_type = "string"; const char* value; PARSE_RETURN_FALSE_IF_FAIL( EntityClassDoom3_parseString( tokeniser, value ) ); if ( string_equal( value, "}" ) ) { // hack for quake4 powerups.def bug - globalErrorStream() << "entityDef " << makeQuoted( entityClass.name() ) << " key " << makeQuoted( tmp ) << " has no value\n"; + globalErrorStream() << "entityDef " << Quoted( entityClass.name() ) << " key " << Quoted( tmp ) << " has no value\n"; break; } else @@ -613,7 +613,7 @@ bool EntityClassDoom3_parse( TextInputStream& inputStream, const char* filename void EntityClassDoom3_loadFile( const char* filename ){ - globalOutputStream() << "parsing entity classes from " << makeQuoted( filename ) << '\n'; + globalOutputStream() << "parsing entity classes from " << Quoted( filename ) << '\n'; const auto fullname = StringStream( "def/", filename ); @@ -654,7 +654,7 @@ void EntityClass_resolveInheritance( EntityClass* derivedClass ){ derivedClass->inheritanceResolved = true; EntityClasses::iterator i = g_EntityClassDoom3_classes.find( derivedClass->m_parent.front().c_str() ); if ( i == g_EntityClassDoom3_classes.end() ) { - globalErrorStream() << "failed to find entityDef " << makeQuoted( derivedClass->m_parent.front() ) << " inherited by " << makeQuoted( derivedClass->name() ) << '\n'; + globalErrorStream() << "failed to find entityDef " << Quoted( derivedClass->m_parent.front() ) << " inherited by " << Quoted( derivedClass->name() ) << '\n'; } else { @@ -688,7 +688,7 @@ public: } void realise() override { if ( --m_unrealised == 0 ) { - globalOutputStream() << "searching vfs directory " << makeQuoted( "def" ) << " for *.def\n"; + globalOutputStream() << "searching vfs directory " << Quoted( "def" ) << " for *.def\n"; GlobalFileSystem().forEachFile( "def/", "def", makeCallbackF( EntityClassDoom3_loadFile ) ); { diff --git a/radiant/eclass_fgd.cpp b/radiant/eclass_fgd.cpp index 8b6ad6a8..9b8f387b 100644 --- a/radiant/eclass_fgd.cpp +++ b/radiant/eclass_fgd.cpp @@ -67,7 +67,7 @@ void EntityClassFGD_clear(){ EntityClass* EntityClassFGD_insertUniqueBase( EntityClass* entityClass ){ auto [ it, inserted ] = g_EntityClassFGD_bases.insert( BaseClasses::value_type( entityClass->name(), entityClass ) ); if ( !inserted ) { - globalErrorStream() << "duplicate base class: " << makeQuoted( entityClass->name() ) << '\n'; + globalErrorStream() << "duplicate base class: " << Quoted( entityClass->name() ) << '\n'; eclass_capture_state( entityClass ); entityClass->free( entityClass ); } @@ -77,7 +77,7 @@ EntityClass* EntityClassFGD_insertUniqueBase( EntityClass* entityClass ){ EntityClass* EntityClassFGD_insertUnique( EntityClass* entityClass ){ auto [ it, inserted ] = g_EntityClassFGD_classes.insert( EntityClasses::value_type( entityClass->name(), entityClass ) ); if ( !inserted ) { - globalErrorStream() << "duplicate entity class: " << makeQuoted( entityClass->name() ) << '\n'; + globalErrorStream() << "duplicate entity class: " << Quoted( entityClass->name() ) << '\n'; eclass_capture_state( entityClass ); entityClass->free( entityClass ); } @@ -92,7 +92,7 @@ inline bool EntityClassFGD_parseToken( Tokeniser& tokeniser, const char* token ) const bool w = s_fgd_warned; const bool ok = string_equal( tokeniser.getToken(), token ); if( !ok ){ - globalErrorStream() << PARSE_ERROR << "\nExpected " << makeQuoted( token ) << '\n'; + globalErrorStream() << PARSE_ERROR << "\nExpected " << Quoted( token ) << '\n'; s_fgd_warned = true; } return w || ok; @@ -524,7 +524,7 @@ void EntityClassFGD_parseClass( Tokeniser& tokeniser, bool fixedsize, bool isBas } else { - ERROR_FGD( "unknown key type: " << makeQuoted( type ) ); + ERROR_FGD( "unknown key type: " << Quoted( type ) ); } tokeniser.nextLine(); } @@ -580,7 +580,7 @@ void EntityClassFGD_parse( TextInputStream& inputStream, const char* path ){ } else { - ERROR_FGD( "unknown block type: " << makeQuoted( blockType ) ); + ERROR_FGD( "unknown block type: " << Quoted( blockType ) ); } } @@ -591,7 +591,7 @@ void EntityClassFGD_parse( TextInputStream& inputStream, const char* path ){ void EntityClassFGD_loadFile( const char* filename ){ TextFileInputStream file( filename ); if ( !file.failed() ) { - globalOutputStream() << "parsing entity classes from " << makeQuoted( filename ) << '\n'; + globalOutputStream() << "parsing entity classes from " << Quoted( filename ) << '\n'; EntityClassFGD_parse( file, filename ); } @@ -612,7 +612,7 @@ void EntityClassFGD_resolveInheritance( EntityClass* derivedClass ){ if ( i == g_EntityClassFGD_bases.end() ) { i = g_EntityClassFGD_classes.find( parentName.c_str() ); if ( i == g_EntityClassFGD_classes.end() ) { - globalErrorStream() << "failed to find entityDef " << makeQuoted( parentName.c_str() ) << " inherited by " << makeQuoted( derivedClass->name() ) << '\n'; + globalErrorStream() << "failed to find entityDef " << Quoted( parentName.c_str() ) << " inherited by " << Quoted( derivedClass->name() ) << '\n'; continue; } } @@ -662,10 +662,10 @@ void EClass_finalize_fgd( EntityClassCollector& collector ){ EntityClassFGD_resolveInheritance( eclass ); if ( eclass->fixedsize && eclass->m_modelpath.empty() ) { if ( !eclass->sizeSpecified ) { - globalErrorStream() << "size not specified for entity class: " << makeQuoted( eclass->name() ) << '\n'; + globalErrorStream() << "size not specified for entity class: " << Quoted( eclass->name() ) << '\n'; } if ( !eclass->colorSpecified ) { - globalErrorStream() << "color not specified for entity class: " << makeQuoted( eclass->name() ) << '\n'; + globalErrorStream() << "color not specified for entity class: " << Quoted( eclass->name() ) << '\n'; } } } diff --git a/radiant/eclass_xml.cpp b/radiant/eclass_xml.cpp index 8e786bd8..cff5f634 100644 --- a/radiant/eclass_xml.cpp +++ b/radiant/eclass_xml.cpp @@ -123,7 +123,7 @@ #include "stringio.h" #include -#define PARSE_ERROR( elementName, name ) makeQuoted( elementName ) << " is not a valid child of " << makeQuoted( name ) +#define PARSE_ERROR( elementName, name ) Quoted( elementName ) << " is not a valid child of " << Quoted( name ) class IgnoreBreaks { @@ -527,7 +527,7 @@ const char* GetExtension(){ void ScanFile( EntityClassCollector& collector, const char *filename ){ TextFileInputStream inputFile( filename ); if ( !inputFile.failed() ) { - globalOutputStream() << "parsing entity classes from " << makeQuoted( filename ) << '\n'; + globalOutputStream() << "parsing entity classes from " << Quoted( filename ) << '\n'; XMLStreamParser parser( inputFile ); diff --git a/radiant/entity.cpp b/radiant/entity.cpp index 0585e1ce..1fc06023 100644 --- a/radiant/entity.cpp +++ b/radiant/entity.cpp @@ -306,7 +306,7 @@ void Entity_moveSelectedPrimitives( bool toLast ){ scene::Node& node = ( !Node_isEntity( path.top() ) && path.size() > 1 )? path.parent() : path.top(); if ( Node_isEntity( node ) && node_is_group( node ) ) { - const auto command = StringStream<64>( "movePrimitivesToEntity ", makeQuoted( Node_getEntity( node )->getClassName() ) ); + const auto command = StringStream<64>( "movePrimitivesToEntity ", Quoted( Node_getEntity( node )->getClassName() ) ); UndoableCommand undo( command ); Scene_parentSelectedBrushesToEntity( GlobalSceneGraph(), node ); } diff --git a/radiant/entityinspector.cpp b/radiant/entityinspector.cpp index d49836cd..d018137e 100644 --- a/radiant/entityinspector.cpp +++ b/radiant/entityinspector.cpp @@ -100,7 +100,7 @@ const char* SelectedEntity_getValueForKey( const char* key ){ } void Scene_EntitySetKeyValue_Selected_Undoable( const char* key, const char* value ){ - const auto command = StringStream( "entitySetKeyValue -key ", makeQuoted( key ), " -value ", makeQuoted( value ) ); + const auto command = StringStream( "entitySetKeyValue -key ", Quoted( key ), " -value ", Quoted( value ) ); UndoableCommand undo( command ); Scene_EntitySetKeyValue_Selected( key, value ); } diff --git a/radiant/environment.cpp b/radiant/environment.cpp index 26646f4b..38317709 100644 --- a/radiant/environment.cpp +++ b/radiant/environment.cpp @@ -226,7 +226,7 @@ const char* getexename( char *buf ){ const int ret = readlink( LINK_NAME, buf, PATH_MAX ); if ( ret == -1 ) { - globalWarningStream() << "getexename: falling back to argv[0]: " << makeQuoted( g_argv[0] ); + globalWarningStream() << "getexename: falling back to argv[0]: " << Quoted( g_argv[0] ); if( realpath( g_argv[0], buf ) == 0 ) *buf = '\0'; /* In case of an error, leave the handling up to the caller */ } diff --git a/radiant/gtkdlgs.cpp b/radiant/gtkdlgs.cpp index f98abf3f..27930803 100644 --- a/radiant/gtkdlgs.cpp +++ b/radiant/gtkdlgs.cpp @@ -2354,7 +2354,7 @@ class TextEditor : public QObject FILE *f = fopen( m_filename.c_str(), "wb" ); //write in binary mode to preserve line feeds if ( f == nullptr ) { - globalErrorStream() << "Error saving file" << makeQuoted( m_filename ) << '\n'; + globalErrorStream() << "Error saving file" << Quoted( m_filename ) << '\n'; return; } @@ -2479,7 +2479,7 @@ void DoShaderView( const char *shaderFileName, const char *shaderName, bool exte #endif } else{ - auto command = StringStream( g_TextEditor_editorCommand, ' ', makeQuoted( pathFull ) ); + auto command = StringStream( g_TextEditor_editorCommand, ' ', Quoted( pathFull ) ); globalOutputStream() << "Launching: " << command << '\n'; // note: linux does not return false if the command failed so it will assume success if ( !Q_Exec( 0, command.c_str(), 0, true, false ) ) diff --git a/radiant/mainframe.cpp b/radiant/mainframe.cpp index 9fdf0ec1..9fd53fda 100644 --- a/radiant/mainframe.cpp +++ b/radiant/mainframe.cpp @@ -441,7 +441,7 @@ public: #else #error "unsupported platform" #endif - const auto text = StringStream( "Select directory, where game executable sits (typically ", makeQuoted( engine ), ")\n" ); + const auto text = StringStream( "Select directory, where game executable sits (typically ", Quoted( engine ), ")\n" ); grid->addWidget( new QLabel( text.c_str() ), 0, 0, 1, 2 ); } { @@ -638,7 +638,7 @@ extern char **environ; #endif void Radiant_Restart(){ if( ConfirmModified( "Restart Radiant" ) ){ - const auto mapname = StringStream( makeQuoted( Map_Name( g_map ) ) ); + const auto mapname = StringStream( Quoted( Map_Name( g_map ) ) ); char *argv[] = { string_clone( environment_get_app_filepath() ), Map_Unnamed( g_map )? nullptr : string_clone( mapname ), diff --git a/radiant/map.cpp b/radiant/map.cpp index deb5b1cd..22874579 100644 --- a/radiant/map.cpp +++ b/radiant/map.cpp @@ -75,13 +75,13 @@ class NameObserver void construct(){ if ( !empty() ) { - //globalOutputStream() << "construct " << makeQuoted( c_str() ) << '\n'; + //globalOutputStream() << "construct " << Quoted( c_str() ) << '\n'; m_names.insert( name_read( c_str() ) ); } } void destroy(){ if ( !empty() ) { - //globalOutputStream() << "destroy " << makeQuoted( c_str() ) << '\n'; + //globalOutputStream() << "destroy " << Quoted( c_str() ) << '\n'; m_names.erase( name_read( c_str() ) ); } } @@ -159,7 +159,7 @@ public: char buffer[1024]; name_write( buffer, uniqueName ); - //globalOutputStream() << "renaming " << makeQuoted( name.c_str() ) << " to " << makeQuoted( buffer ) << '\n'; + //globalOutputStream() << "renaming " << Quoted( name.c_str() ) << " to " << Quoted( buffer ) << '\n'; for ( const NameCallback& nameCallback : setNameCallbacks ) { @@ -340,7 +340,7 @@ bool Map_Unnamed( const Map& map ){ inline const MapFormat& MapFormat_forFile( const char* filename ){ const char* moduleName = findModuleName( GetFileTypeRegistry(), MapFormat::Name, path_get_extension( filename ) ); MapFormat* format = Radiant_getMapModules().findModule( moduleName ); - ASSERT_MESSAGE( format != 0, "map format not found for file " << makeQuoted( filename ) ); + ASSERT_MESSAGE( format != 0, "map format not found for file " << Quoted( filename ) ); return *format; } @@ -1585,14 +1585,14 @@ tryDecompile: StringOutputStream str( 256 ); str << AppPath_get() << "q3map2." << RADIANT_EXECUTABLE << " -v -game " << ( ( type && *type ) ? type : "quake3" ) - << " -fs_basepath " << makeQuoted( EnginePath_get() ) - << " -fs_homepath " << makeQuoted( g_qeglobals.m_userEnginePath ) + << " -fs_basepath " << Quoted( EnginePath_get() ) + << " -fs_homepath " << Quoted( g_qeglobals.m_userEnginePath ) << " -fs_game " << gamename_get() << " -convert -format " << ( BrushType_getTexdefType( GlobalBrushCreator().getFormat() ) == TEXDEFTYPEID_QUAKE ? "map" : "map_bp" ); if ( path_extension_is( filename, "map" ) ) { str << " -readmap "; } - str << ' ' << makeQuoted( filename ); + str << ' ' << Quoted( filename ); // run Q_Exec( nullptr, str.c_str(), nullptr, false, true ); @@ -2257,11 +2257,11 @@ void map_autocaulk_selected(){ StringOutputStream str( 256 ); str << AppPath_get() << "q3map2." << RADIANT_EXECUTABLE << " -game quake3" - << " -fs_basepath " << makeQuoted( EnginePath_get() ) - << " -fs_homepath " << makeQuoted( g_qeglobals.m_userEnginePath ) + << " -fs_basepath " << Quoted( EnginePath_get() ) + << " -fs_homepath " << Quoted( g_qeglobals.m_userEnginePath ) << " -fs_game " << gamename_get() << " -autocaulk -fulldetail " - << makeQuoted( filename ); + << Quoted( filename ); // run Q_Exec( nullptr, str.c_str(), nullptr, false, true ); } diff --git a/radiant/preferences.cpp b/radiant/preferences.cpp index a14ab803..9be8275f 100644 --- a/radiant/preferences.cpp +++ b/radiant/preferences.cpp @@ -97,7 +97,7 @@ CGameDescription::CGameDescription( xmlDocPtr pDoc, const CopiedString& gameFile mGameToolsPath = StringStream( AppPath_get(), "gamepacks/", gameFile, '/' ); - ASSERT_MESSAGE( file_exists( mGameToolsPath.c_str() ), "game directory not found: " << makeQuoted( mGameToolsPath ) ); + ASSERT_MESSAGE( file_exists( mGameToolsPath.c_str() ), "game directory not found: " << Quoted( mGameToolsPath ) ); mGameFile = gameFile; @@ -116,10 +116,10 @@ CGameDescription::CGameDescription( xmlDocPtr pDoc, const CopiedString& gameFile } void CGameDescription::Dump(){ - globalOutputStream() << "game description file: " << makeQuoted( mGameFile ) << '\n'; + globalOutputStream() << "game description file: " << Quoted( mGameFile ) << '\n'; for ( const auto& [ key, value ] : m_gameDescription ) { - globalOutputStream() << key << " = " << makeQuoted( value ) << '\n'; + globalOutputStream() << key << " = " << Quoted( value ) << '\n'; } } @@ -197,7 +197,7 @@ void CGameDialog::LoadPrefs(){ // load global .pref file const auto strGlobalPref = StringStream( g_Preferences.m_global_rc_path, PREFS_GLOBAL_FILENAME ); - globalOutputStream() << "loading global preferences from " << makeQuoted( strGlobalPref ) << '\n'; + globalOutputStream() << "loading global preferences from " << Quoted( strGlobalPref ) << '\n'; if ( !Preferences_Load( g_global_preferences, strGlobalPref, "global" ) ) { globalOutputStream() << "failed to load global preferences from " << strGlobalPref << '\n'; diff --git a/radiant/preferences.h b/radiant/preferences.h index 48400097..18aa2294 100644 --- a/radiant/preferences.h +++ b/radiant/preferences.h @@ -191,7 +191,7 @@ public: if ( i != m_gameDescription.end() ) { return ( *i ).second.c_str(); } - ERROR_MESSAGE( "game attribute " << makeQuoted( key ) << " not found in " << makeQuoted( mGameFile ) ); + ERROR_MESSAGE( "game attribute " << Quoted( key ) << " not found in " << Quoted( mGameFile ) ); return ""; } diff --git a/radiant/qe3.cpp b/radiant/qe3.cpp index ad0a83e4..79ec627d 100644 --- a/radiant/qe3.cpp +++ b/radiant/qe3.cpp @@ -158,7 +158,7 @@ void build_init_variables(){ build_set_variable( "UserEnginePath", g_qeglobals.m_userEnginePath.c_str() ); for( const auto& path : ExtraResourcePaths_get() ) if( !path.empty() ) - stream << " -fs_pakpath " << makeQuoted( path ); + stream << " -fs_pakpath " << Quoted( path ); build_set_variable( "ExtraResourcePaths", stream ); build_set_variable( "MonitorAddress", ( g_WatchBSP_Enabled ) ? RADIANT_MONITOR_ADDRESS : "" ); build_set_variable( "GameName", gamename_get() ); @@ -190,7 +190,7 @@ public: m_file << command; if( m_outputRedirect ){ m_file << ( m_commandCount == 0? " > " : " >> " ); - m_file << makeQuoted( m_outputRedirect ); + m_file << Quoted( m_outputRedirect ); } m_file << '\n'; ++m_commandCount; diff --git a/radiant/referencecache.cpp b/radiant/referencecache.cpp index ee285e1c..29bb3148 100644 --- a/radiant/referencecache.cpp +++ b/radiant/referencecache.cpp @@ -89,14 +89,14 @@ NodeSmartReference MapResource_load( const MapFormat& format, const char* path, } else { - globalErrorStream() << "map path is not fully qualified: " << makeQuoted( fullpath ) << '\n'; + globalErrorStream() << "map path is not fully qualified: " << Quoted( fullpath ) << '\n'; } return root; } bool MapResource_saveFile( const MapFormat& format, scene::Node& root, GraphTraversalFunc traverse, const char* filename ){ - //ASSERT_MESSAGE( path_is_absolute( filename ), "MapResource_saveFile: path is not absolute: " << makeQuoted( filename ) ); + //ASSERT_MESSAGE( path_is_absolute( filename ), "MapResource_saveFile: path is not absolute: " << Quoted( filename ) ); globalOutputStream() << "Open file " << filename << " for write..."; TextFileOutputStream file( filename ); if ( !file.failed() ) { @@ -119,7 +119,7 @@ bool file_saveBackup( const char* path ){ if ( !file_exists( path ) ) { return true; // nothing to move, no wonder it failed } - globalErrorStream() << "map path (or backup path) is not writable: " << makeQuoted( path ) << '\n'; + globalErrorStream() << "map path (or backup path) is not writable: " << Quoted( path ) << '\n'; return false; } @@ -134,11 +134,11 @@ bool MapResource_save( const MapFormat& format, scene::Node& root, const char* p return MapResource_saveFile( format, root, Map_Traverse, fullpath ); } - globalErrorStream() << "failed to save map file: " << makeQuoted( fullpath ) << '\n'; + globalErrorStream() << "failed to save map file: " << Quoted( fullpath ) << '\n'; return false; } - globalErrorStream() << "map path is not fully qualified: " << makeQuoted( fullpath ) << '\n'; + globalErrorStream() << "map path is not fully qualified: " << Quoted( fullpath ) << '\n'; return false; } @@ -347,7 +347,7 @@ struct ModelResource final : public Resource if ( realised() ) { unrealise(); } - ASSERT_MESSAGE( !realised(), "ModelResource::~ModelResource: resource reference still realised: " << makeQuoted( m_name ) ); + ASSERT_MESSAGE( !realised(), "ModelResource::~ModelResource: resource reference still realised: " << Quoted( m_name ) ); } // NOT COPYABLE ModelResource( const ModelResource& ) = delete; diff --git a/radiant/renderstate.cpp b/radiant/renderstate.cpp index c1072960..d579d05a 100644 --- a/radiant/renderstate.cpp +++ b/radiant/renderstate.cpp @@ -154,7 +154,7 @@ void createShader( GLuint program, const char* filename, GLenum type ){ { std::size_t size = file_size( filename ); FileInputStream file( filename ); - ASSERT_MESSAGE( !file.failed(), "failed to open " << makeQuoted( filename ) ); + ASSERT_MESSAGE( !file.failed(), "failed to open " << Quoted( filename ) ); Array buffer( size ); size = file.read( reinterpret_cast( buffer.data() ), size ); @@ -174,7 +174,7 @@ void createShader( GLuint program, const char* filename, GLenum type ){ printShaderLog( shader ); } - ASSERT_MESSAGE( compiled, "shader compile failed: " << makeQuoted( filename ) ); + ASSERT_MESSAGE( compiled, "shader compile failed: " << Quoted( filename ) ); } // attach shader @@ -854,7 +854,7 @@ public: ~OpenGLShaderCache(){ for ( auto& shader : m_shaders ) { - globalOutputStream() << "leaked shader: " << makeQuoted( shader.key ) << '\n'; + globalOutputStream() << "leaked shader: " << Quoted( shader.key ) << '\n'; } } Shader* capture( const char* name ) override { @@ -863,15 +863,15 @@ public: || *name == '<' || *name == '(' || *name == '{' - || strchr( name, '\\' ) == 0, "shader name contains invalid characters: " << makeQuoted( name ) ); + || strchr( name, '\\' ) == 0, "shader name contains invalid characters: " << Quoted( name ) ); #if DEBUG_SHADERS - globalOutputStream() << "shaders capture: " << makeQuoted( name ) << '\n'; + globalOutputStream() << "shaders capture: " << Quoted( name ) << '\n'; #endif return m_shaders.capture( name ).get(); } void release( const char *name ) override { #if DEBUG_SHADERS - globalOutputStream() << "shaders release: " << makeQuoted( name ) << '\n'; + globalOutputStream() << "shaders release: " << Quoted( name ) << '\n'; #endif m_shaders.release( name ); } diff --git a/radiant/server.cpp b/radiant/server.cpp index e9b955f6..34fa88d8 100644 --- a/radiant/server.cpp +++ b/radiant/server.cpp @@ -71,11 +71,11 @@ public: void registerModule( const char* type, int version, const char* name, Module& module ) override { ASSERT_NOTNULL( (volatile intptr_t)&module ); if ( !m_modules.insert( Modules_::value_type( ModuleKey( type, version, name ), &module ) ).second ) { - globalErrorStream() << "module already registered: type=" << makeQuoted( type ) << " name=" << makeQuoted( name ) << '\n'; + globalErrorStream() << "module already registered: type=" << Quoted( type ) << " name=" << Quoted( name ) << '\n'; } else { - globalOutputStream() << "Module Registered: type=" << makeQuoted( type ) << " version=" << makeQuoted( version ) << " name=" << makeQuoted( name ) << '\n'; + globalOutputStream() << "Module Registered: type=" << Quoted( type ) << " version=" << Quoted( version ) << " name=" << Quoted( name ) << '\n'; } } diff --git a/radiant/textures.cpp b/radiant/textures.cpp index 220111fc..1b4db8eb 100644 --- a/radiant/textures.cpp +++ b/radiant/textures.cpp @@ -477,13 +477,13 @@ public: } qtexture_t* capture( const LoadImageCallback& loader, const char* name ) override { #if DEBUG_TEXTURES - globalOutputStream() << "textures capture: " << makeQuoted( name ) << '\n'; + globalOutputStream() << "textures capture: " << Quoted( name ) << '\n'; #endif return m_qtextures.capture( TextureKey( loader, name ) ).get(); } void release( qtexture_t* texture ) override { #if DEBUG_TEXTURES - globalOutputStream() << "textures release: " << makeQuoted( texture->name ) << '\n'; + globalOutputStream() << "textures release: " << Quoted( texture->name ) << '\n'; #endif m_qtextures.release( TextureKey( texture->load, texture->name ) ); } diff --git a/radiant/texwindow.cpp b/radiant/texwindow.cpp index ae28e603..226dc95c 100644 --- a/radiant/texwindow.cpp +++ b/radiant/texwindow.cpp @@ -707,12 +707,12 @@ void TextureBrowser_ShowDirectory( const char* directory ){ Archive* archive = GlobalFileSystem().getArchive( directory ); //ASSERT_NOTNULL( archive ); if( archive ){ - globalOutputStream() << "Loading " << makeQuoted( directory ) << " wad file.\n"; + globalOutputStream() << "Loading " << Quoted( directory ) << " wad file.\n"; LoadShaderVisitor visitor; archive->forEachFile( Archive::VisitorFunc( visitor, Archive::eFiles, 0 ), "textures/" ); } else{ - globalErrorStream() << "Attempted to load " << makeQuoted( directory ) << " wad file.\n"; + globalErrorStream() << "Attempted to load " << Quoted( directory ) << " wad file.\n"; } } else diff --git a/radiant/watchbsp.cpp b/radiant/watchbsp.cpp index 889a64a5..37b65209 100644 --- a/radiant/watchbsp.cpp +++ b/radiant/watchbsp.cpp @@ -335,7 +335,7 @@ static void saxStartElement( message_info_t *data, const xmlChar *name, const xm if ( attrs != 0 ) { for ( const xmlChar** p = attrs; *p != 0; p += 2 ) { - globalOutputStream() << ' ' << p[0] << '=' << makeQuoted( p[1] ); + globalOutputStream() << ' ' << p[0] << '=' << Quoted( p[1] ); } } globalOutputStream() << ">\n";