From 840aaba5d4df5dee308a812e8a07c9c1d9d4ad19 Mon Sep 17 00:00:00 2001 From: kervala Date: Tue, 15 Nov 2016 10:58:51 +0100 Subject: [PATCH] Changed: Constify some methods --- code/nel/include/nel/3d/portal.h | 4 ++-- code/nel/include/nel/ligo/ligo_config.h | 6 +++--- code/nel/src/ligo/ligo_config.cpp | 6 +++--- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/code/nel/include/nel/3d/portal.h b/code/nel/include/nel/3d/portal.h index 0531f9eb5..51fd99913 100644 --- a/code/nel/include/nel/3d/portal.h +++ b/code/nel/include/nel/3d/portal.h @@ -92,9 +92,9 @@ public: void setWorldMatrix (const NLMISC::CMatrix &WM); - void setName (std::string &name) { _Name = name; } + void setName (const std::string &name) { _Name = name; } - std::string getName () { return _Name; } + std::string getName () const { return _Name; } void open (bool opened) { _Opened = opened; } bool isOpened () { return _Opened; } diff --git a/code/nel/include/nel/ligo/ligo_config.h b/code/nel/include/nel/ligo/ligo_config.h index 8e2c38e25..4d93843e5 100644 --- a/code/nel/include/nel/ligo/ligo_config.h +++ b/code/nel/include/nel/ligo/ligo_config.h @@ -49,13 +49,13 @@ public: * This file will try to open the file ligo class description file (XML) using the LigoClass as file name. * It will try first to load directly the file and then to lookup the file in NLMISC::CPath. */ - bool readConfigFile (const char *fileName, bool parsePrimitiveComboContent); + bool readConfigFile (const std::string &fileName, bool parsePrimitiveComboContent); /** * This file will read the file ligo class description file (XML) using the LigoClass as file name. * It will try first to load directly the file and then to lookup the file in NLMISC::CPath. */ - bool readPrimitiveClass (const char *fileName, bool parsePrimitiveComboContent); + bool readPrimitiveClass (const std::string &fileName, bool parsePrimitiveComboContent); bool reloadIndexFile(const std::string &indexFileName = std::string()); @@ -100,7 +100,7 @@ public: /// Build a standard human readable alias string std::string aliasToString(uint32 fullAlias); /// Read a standard human readable alias string - uint32 aliasFromString(std::string fullAlias); + uint32 aliasFromString(const std::string &fullAlias); // Get a primitive class diff --git a/code/nel/src/ligo/ligo_config.cpp b/code/nel/src/ligo/ligo_config.cpp index f836c808e..7139221e6 100644 --- a/code/nel/src/ligo/ligo_config.cpp +++ b/code/nel/src/ligo/ligo_config.cpp @@ -39,7 +39,7 @@ CLigoConfig::CLigoConfig() // *************************************************************************** -bool CLigoConfig::readConfigFile (const char *fileName, bool parsePrimitiveComboContent) +bool CLigoConfig::readConfigFile (const std::string &fileName, bool parsePrimitiveComboContent) { // The CF CConfigFile cf; @@ -73,7 +73,7 @@ bool CLigoConfig::readConfigFile (const char *fileName, bool parsePrimitiveCombo // *************************************************************************** -bool CLigoConfig::readPrimitiveClass (const char *_fileName, bool parsePrimitiveComboContent) +bool CLigoConfig::readPrimitiveClass (const std::string &_fileName, bool parsePrimitiveComboContent) { // File exist ? string filename = _fileName; @@ -785,7 +785,7 @@ std::string CLigoConfig::aliasToString(uint32 fullAlias) } -uint32 CLigoConfig::aliasFromString(std::string fullAlias) +uint32 CLigoConfig::aliasFromString(const std::string &fullAlias) { uint32 staticPart; uint32 dynPart;