refactor: use new line character instead of std::endl

This commit is contained in:
Jan
2024-03-24 20:24:22 +01:00
parent 1b13f1f1b4
commit 132cccb971
49 changed files with 213 additions and 217 deletions

View File

@ -39,7 +39,7 @@ bool ZoneCreator::CreateIgnoredAssetMap(const ZoneCreationContext& context, std:
const auto foundAssetTypeEntry = m_asset_types_by_name.find(ignoreEntry.m_type);
if (foundAssetTypeEntry == m_asset_types_by_name.end())
{
std::cout << "Unknown asset type \"" << ignoreEntry.m_type << "\" for ignore \"" << ignoreEntry.m_name << "\"" << std::endl;
std::cout << "Unknown asset type \"" << ignoreEntry.m_type << "\" for ignore \"" << ignoreEntry.m_name << "\"\n";
return false;
}
@ -84,7 +84,7 @@ std::unique_ptr<Zone> ZoneCreator::CreateZoneForDefinition(ZoneCreationContext&
const auto foundAssetTypeEntry = m_asset_types_by_name.find(assetEntry.m_asset_type);
if (foundAssetTypeEntry == m_asset_types_by_name.end())
{
std::cout << "Unknown asset type \"" << assetEntry.m_asset_type << "\"" << std::endl;
std::cout << "Unknown asset type \"" << assetEntry.m_asset_type << "\"\n";
return nullptr;
}

View File

@ -38,7 +38,7 @@ bool ZoneCreator::CreateIgnoredAssetMap(const ZoneCreationContext& context, std:
const auto foundAssetTypeEntry = m_asset_types_by_name.find(ignoreEntry.m_type);
if (foundAssetTypeEntry == m_asset_types_by_name.end())
{
std::cout << "Unknown asset type \"" << ignoreEntry.m_type << "\" for ignore \"" << ignoreEntry.m_name << "\"" << std::endl;
std::cout << "Unknown asset type \"" << ignoreEntry.m_type << "\" for ignore \"" << ignoreEntry.m_name << "\"\n";
return false;
}
@ -83,7 +83,7 @@ std::unique_ptr<Zone> ZoneCreator::CreateZoneForDefinition(ZoneCreationContext&
const auto foundAssetTypeEntry = m_asset_types_by_name.find(assetEntry.m_asset_type);
if (foundAssetTypeEntry == m_asset_types_by_name.end())
{
std::cout << "Unknown asset type \"" << assetEntry.m_asset_type << "\"" << std::endl;
std::cout << "Unknown asset type \"" << assetEntry.m_asset_type << "\"\n";
return nullptr;
}

View File

@ -38,7 +38,7 @@ bool ZoneCreator::CreateIgnoredAssetMap(const ZoneCreationContext& context, std:
const auto foundAssetTypeEntry = m_asset_types_by_name.find(ignoreEntry.m_type);
if (foundAssetTypeEntry == m_asset_types_by_name.end())
{
std::cout << "Unknown asset type \"" << ignoreEntry.m_type << "\" for ignore \"" << ignoreEntry.m_name << "\"" << std::endl;
std::cout << "Unknown asset type \"" << ignoreEntry.m_type << "\" for ignore \"" << ignoreEntry.m_name << "\"\n";
return false;
}
@ -83,7 +83,7 @@ std::unique_ptr<Zone> ZoneCreator::CreateZoneForDefinition(ZoneCreationContext&
const auto foundAssetTypeEntry = m_asset_types_by_name.find(assetEntry.m_asset_type);
if (foundAssetTypeEntry == m_asset_types_by_name.end())
{
std::cout << "Unknown asset type \"" << assetEntry.m_asset_type << "\"" << std::endl;
std::cout << "Unknown asset type \"" << assetEntry.m_asset_type << "\"\n";
return nullptr;
}

View File

@ -39,7 +39,7 @@ bool ZoneCreator::CreateIgnoredAssetMap(const ZoneCreationContext& context, std:
const auto foundAssetTypeEntry = m_asset_types_by_name.find(ignoreEntry.m_type);
if (foundAssetTypeEntry == m_asset_types_by_name.end())
{
std::cout << "Unknown asset type \"" << ignoreEntry.m_type << "\" for ignore \"" << ignoreEntry.m_name << "\"" << std::endl;
std::cout << "Unknown asset type \"" << ignoreEntry.m_type << "\" for ignore \"" << ignoreEntry.m_name << "\"\n";
return false;
}
@ -84,7 +84,7 @@ std::unique_ptr<Zone> ZoneCreator::CreateZoneForDefinition(ZoneCreationContext&
const auto foundAssetTypeEntry = m_asset_types_by_name.find(assetEntry.m_asset_type);
if (foundAssetTypeEntry == m_asset_types_by_name.end())
{
std::cout << "Unknown asset type \"" << assetEntry.m_asset_type << "\"" << std::endl;
std::cout << "Unknown asset type \"" << assetEntry.m_asset_type << "\"\n";
return nullptr;
}

View File

@ -40,7 +40,7 @@ bool ZoneCreator::CreateIgnoredAssetMap(const ZoneCreationContext& context, std:
const auto foundAssetTypeEntry = m_asset_types_by_name.find(ignoreEntry.m_type);
if (foundAssetTypeEntry == m_asset_types_by_name.end())
{
std::cout << "Unknown asset type \"" << ignoreEntry.m_type << "\" for ignore \"" << ignoreEntry.m_name << "\"" << std::endl;
std::cout << "Unknown asset type \"" << ignoreEntry.m_type << "\" for ignore \"" << ignoreEntry.m_name << "\"\n";
return false;
}
@ -78,7 +78,7 @@ void ZoneCreator::HandleMetadata(Zone* zone, const ZoneCreationContext& context)
if (endPtr != &strValue[strValue.size()])
{
std::cout << "Could not parse metadata key \"" << metaData->m_key << "\" as hash" << std::endl;
std::cout << "Could not parse metadata key \"" << metaData->m_key << "\" as hash\n";
continue;
}
}
@ -135,7 +135,7 @@ std::unique_ptr<Zone> ZoneCreator::CreateZoneForDefinition(ZoneCreationContext&
const auto foundAssetTypeEntry = m_asset_types_by_name.find(assetEntry.m_asset_type);
if (foundAssetTypeEntry == m_asset_types_by_name.end())
{
std::cout << "Unknown asset type \"" << assetEntry.m_asset_type << "\"" << std::endl;
std::cout << "Unknown asset type \"" << assetEntry.m_asset_type << "\"\n";
return nullptr;
}

View File

@ -90,7 +90,7 @@ class LinkerImpl final : public Linker
const auto definitionStream = sourceSearchPath->Open(definitionFileName);
if (!definitionStream.IsOpen())
{
std::cout << "Could not find zone definition file for project \"" << source << "\"." << std::endl;
std::cout << "Could not find zone definition file for project \"" << source << "\".\n";
return false;
}
@ -100,7 +100,7 @@ class LinkerImpl final : public Linker
if (!includeDefinition)
{
std::cout << "Failed to read zone definition file for project \"" << source << "\"." << std::endl;
std::cout << "Failed to read zone definition file for project \"" << source << "\".\n";
return false;
}
@ -183,7 +183,7 @@ class LinkerImpl final : public Linker
{
if (name != i->second->m_value)
{
std::cout << "Conflicting names in target \"" << targetName << "\": " << name << " != " << i->second << std::endl;
std::cout << "Conflicting names in target \"" << targetName << "\": " << name << " != " << i->second << "\n";
return false;
}
}
@ -203,7 +203,7 @@ class LinkerImpl final : public Linker
const auto definitionStream = sourceSearchPath->Open(definitionFileName);
if (!definitionStream.IsOpen())
{
std::cout << "Could not find zone definition file for target \"" << targetName << "\"." << std::endl;
std::cout << "Could not find zone definition file for target \"" << targetName << "\".\n";
return nullptr;
}
@ -213,7 +213,7 @@ class LinkerImpl final : public Linker
if (!zoneDefinition)
{
std::cout << "Failed to read zone definition file for target \"" << targetName << "\"." << std::endl;
std::cout << "Failed to read zone definition file for target \"" << targetName << "\".\n";
return nullptr;
}
@ -248,7 +248,7 @@ class LinkerImpl final : public Linker
std::vector<AssetListEntry> assetList;
if (!ReadAssetList(ignore, context.m_ignored_assets, sourceSearchPath))
{
std::cout << "Failed to read asset listing for ignoring assets of project \"" << ignore << "\"." << std::endl;
std::cout << "Failed to read asset listing for ignoring assets of project \"" << ignore << "\".\n";
return false;
}
}
@ -292,7 +292,7 @@ class LinkerImpl final : public Linker
if (projectType != parsedProjectType)
{
std::cerr << "Conflicting types in target \"" << targetName << "\": " << PROJECT_TYPE_NAMES[static_cast<unsigned>(projectType)]
<< " != " << PROJECT_TYPE_NAMES[static_cast<unsigned>(parsedProjectType)] << std::endl;
<< " != " << PROJECT_TYPE_NAMES[static_cast<unsigned>(parsedProjectType)] << "\n";
return false;
}
}
@ -324,7 +324,7 @@ class LinkerImpl final : public Linker
{
if (gameName != i->second->m_value)
{
std::cout << "Conflicting game names in target \"" << targetName << "\": " << gameName << " != " << i->second << std::endl;
std::cout << "Conflicting game names in target \"" << targetName << "\": " << gameName << " != " << i->second << "\n";
return false;
}
}
@ -332,7 +332,7 @@ class LinkerImpl final : public Linker
if (firstGameEntry)
{
std::cout << "No game name was specified for target \"" << targetName << "\"" << std::endl;
std::cout << "No game name was specified for target \"" << targetName << "\"\n";
return false;
}
@ -347,7 +347,7 @@ class LinkerImpl final : public Linker
const auto gdtFile = gdtSearchPath->Open(i->second->m_value + ".gdt");
if (!gdtFile.IsOpen())
{
std::cout << "Failed to open file for gdt \"" << i->second->m_value << "\"" << std::endl;
std::cout << "Failed to open file for gdt \"" << i->second->m_value << "\"\n";
return false;
}
@ -355,7 +355,7 @@ class LinkerImpl final : public Linker
auto gdt = std::make_unique<Gdt>();
if (!gdtReader.Read(*gdt))
{
std::cout << "Failed to read gdt file \"" << i->second << "\"" << std::endl;
std::cout << "Failed to read gdt file \"" << i->second << "\"\n";
return false;
}
@ -402,7 +402,7 @@ class LinkerImpl final : public Linker
if (!ZoneWriting::WriteZone(stream, zone))
{
std::cout << "Writing zone failed." << std::endl;
std::cout << "Writing zone failed.\n";
stream.close();
return false;
}
@ -454,7 +454,7 @@ class LinkerImpl final : public Linker
if (!ipakWriter->Write())
{
std::cout << "Writing ipak failed." << std::endl;
std::cout << "Writing ipak failed.\n";
stream.close();
return false;
}

View File

@ -45,12 +45,12 @@ SearchPaths LinkerSearchPaths::GetAssetSearchPathsForProject(const std::string&
if (!fs::is_directory(absolutePath))
{
if (m_args.m_verbose)
std::cout << "Adding asset search path (Not found): " << absolutePath.string() << std::endl;
std::cout << "Adding asset search path (Not found): " << absolutePath.string() << "\n";
continue;
}
if (m_args.m_verbose)
std::cout << "Adding asset search path: " << absolutePath.string() << std::endl;
std::cout << "Adding asset search path: " << absolutePath.string() << "\n";
auto searchPath = std::make_unique<SearchPathFilesystem>(searchPathStr);
LoadSearchPath(searchPath.get());
@ -79,12 +79,12 @@ SearchPaths LinkerSearchPaths::GetGdtSearchPathsForProject(const std::string& ga
if (!fs::is_directory(absolutePath))
{
if (m_args.m_verbose)
std::cout << "Adding gdt search path (Not found): " << absolutePath.string() << std::endl;
std::cout << "Adding gdt search path (Not found): " << absolutePath.string() << "\n";
continue;
}
if (m_args.m_verbose)
std::cout << "Adding gdt search path: " << absolutePath.string() << std::endl;
std::cout << "Adding gdt search path: " << absolutePath.string() << "\n";
searchPathsForProject.CommitSearchPath(std::make_unique<SearchPathFilesystem>(searchPathStr));
}
@ -105,12 +105,12 @@ SearchPaths LinkerSearchPaths::GetSourceSearchPathsForProject(const std::string&
if (!fs::is_directory(absolutePath))
{
if (m_args.m_verbose)
std::cout << "Adding source search path (Not found): " << absolutePath.string() << std::endl;
std::cout << "Adding source search path (Not found): " << absolutePath.string() << "\n";
continue;
}
if (m_args.m_verbose)
std::cout << "Adding source search path: " << absolutePath.string() << std::endl;
std::cout << "Adding source search path: " << absolutePath.string() << "\n";
searchPathsForProject.CommitSearchPath(std::make_unique<SearchPathFilesystem>(searchPathStr));
}
@ -129,12 +129,12 @@ bool LinkerSearchPaths::BuildProjectIndependentSearchPaths()
if (!fs::is_directory(absolutePath))
{
if (m_args.m_verbose)
std::cout << "Adding asset search path (Not found): " << absolutePath.string() << std::endl;
std::cout << "Adding asset search path (Not found): " << absolutePath.string() << "\n";
continue;
}
if (m_args.m_verbose)
std::cout << "Adding asset search path: " << absolutePath.string() << std::endl;
std::cout << "Adding asset search path: " << absolutePath.string() << "\n";
auto searchPath = std::make_unique<SearchPathFilesystem>(absolutePath.string());
LoadSearchPath(searchPath.get());
@ -148,12 +148,12 @@ bool LinkerSearchPaths::BuildProjectIndependentSearchPaths()
if (!fs::is_directory(absolutePath))
{
if (m_args.m_verbose)
std::cout << "Loading gdt search path (Not found): " << absolutePath.string() << std::endl;
std::cout << "Loading gdt search path (Not found): " << absolutePath.string() << "\n";
continue;
}
if (m_args.m_verbose)
std::cout << "Adding gdt search path: " << absolutePath.string() << std::endl;
std::cout << "Adding gdt search path: " << absolutePath.string() << "\n";
m_gdt_search_paths.CommitSearchPath(std::make_unique<SearchPathFilesystem>(absolutePath.string()));
}
@ -165,12 +165,12 @@ bool LinkerSearchPaths::BuildProjectIndependentSearchPaths()
if (!fs::is_directory(absolutePath))
{
if (m_args.m_verbose)
std::cout << "Loading source search path (Not found): " << absolutePath.string() << std::endl;
std::cout << "Loading source search path (Not found): " << absolutePath.string() << "\n";
continue;
}
if (m_args.m_verbose)
std::cout << "Adding source search path: " << absolutePath.string() << std::endl;
std::cout << "Adding source search path: " << absolutePath.string() << "\n";
m_source_search_paths.CommitSearchPath(std::make_unique<SearchPathFilesystem>(absolutePath.string()));
}