1
0
forked from 0ad/0ad

Some const refs and one const function.

This was SVN commit r16882.
This commit is contained in:
leper 2015-07-27 01:08:25 +00:00
parent bd53e9d736
commit da48c8c26f
6 changed files with 10 additions and 10 deletions

View File

@ -19,10 +19,10 @@
#include "TemplateLoader.h"
#include "lib/utf8.h"
#include "ps/CLogger.h"
#include "ps/Filesystem.h"
#include "ps/XML/Xeromyces.h"
#include "lib/utf8.h"
static const wchar_t TEMPLATE_ROOT[] = L"simulation/templates/";
static const wchar_t ACTOR_ROOT[] = L"art/actors/";
@ -206,7 +206,7 @@ static Status AddActorToTemplates(const VfsPath& pathname, const CFileInfo& UNUS
return INFO::OK;
}
bool CTemplateLoader::TemplateExists(const std::string& templateName)
bool CTemplateLoader::TemplateExists(const std::string& templateName) const
{
size_t pos = templateName.rfind('|');
std::string baseName(pos != std::string::npos ? templateName.substr(pos+1) : templateName);

View File

@ -57,7 +57,7 @@ public:
/**
* Check if the template XML file exits, without trying to load it.
*/
bool TemplateExists(const std::string& templateName);
bool TemplateExists(const std::string& templateName) const;
/**
* Returns a list of strings that could be validly passed as @c templateName to LoadTemplateFile.

View File

@ -1,4 +1,4 @@
/* Copyright (C) 2014 Wildfire Games.
/* Copyright (C) 2015 Wildfire Games.
* This file is part of 0 A.D.
*
* 0 A.D. is free software: you can redistribute it and/or modify
@ -537,7 +537,7 @@ std::vector<CStrW> CPostprocManager::GetPostEffects()
return effects;
}
void CPostprocManager::SetPostEffect(CStrW name)
void CPostprocManager::SetPostEffect(const CStrW& name)
{
if (m_IsInitialized)
{
@ -596,7 +596,7 @@ std::vector<CStrW> CPostprocManager::GetPostEffects()
return std::vector<CStrW>();
}
void CPostprocManager::SetPostEffect(CStrW UNUSED(name))
void CPostprocManager::SetPostEffect(const CStrW& UNUSED(name))
{
}

View File

@ -1,4 +1,4 @@
/* Copyright (C) 2014 Wildfire Games.
/* Copyright (C) 2015 Wildfire Games.
* This file is part of 0 A.D.
*
* 0 A.D. is free software: you can redistribute it and/or modify
@ -97,7 +97,7 @@ public:
}
// Sets the current effect.
void SetPostEffect(CStrW name);
void SetPostEffect(const CStrW& name);
// Clears the two color buffers and depth buffer, and redirects all rendering
// to our textures instead of directly to the system framebuffer.

View File

@ -1170,7 +1170,7 @@ JS::Value CComponentManager::Script_ReadCivJSONFile(ScriptInterface::CxPrivate*
return ReadJSONFile(pCxPrivate, L"simulation/data/civs", fileName);
}
JS::Value CComponentManager::ReadJSONFile(ScriptInterface::CxPrivate* pCxPrivate, std::wstring filePath, std::wstring fileName)
JS::Value CComponentManager::ReadJSONFile(ScriptInterface::CxPrivate* pCxPrivate, const std::wstring& filePath, const std::wstring& fileName)
{
CComponentManager* componentManager = static_cast<CComponentManager*> (pCxPrivate->pCBData);
JSContext* cx = pCxPrivate->pScriptInterface->GetContext();

View File

@ -328,7 +328,7 @@ private:
static JS::Value Script_ReadJSONFile(ScriptInterface::CxPrivate* pCxPrivate, std::wstring fileName);
static JS::Value Script_ReadCivJSONFile(ScriptInterface::CxPrivate* pCxPrivate, std::wstring fileName);
static std::vector<std::string> Script_FindJSONFiles(ScriptInterface::CxPrivate* pCxPrivate, std::wstring subPath, bool recursive);
static JS::Value ReadJSONFile(ScriptInterface::CxPrivate* pCxPrivate, std::wstring filePath, std::wstring fileName);
static JS::Value ReadJSONFile(ScriptInterface::CxPrivate* pCxPrivate, const std::wstring& filePath, const std::wstring& fileName);
// callback function to handle recursively finding files in a directory
static Status FindJSONFilesCallback(const VfsPath&, const CFileInfo&, const uintptr_t);