From e75e59008c595bb6abcc4595edd3cd352a609e89 Mon Sep 17 00:00:00 2001 From: jean-pierre roux Date: Thu, 1 Apr 2010 11:05:21 +0000 Subject: [PATCH] Pass std::string as reference --- src/creaSystem.cxx | 15 ++++----------- src/creaSystem.h | 14 +++----------- 2 files changed, 7 insertions(+), 22 deletions(-) diff --git a/src/creaSystem.cxx b/src/creaSystem.cxx index 7060109..69293a9 100644 --- a/src/creaSystem.cxx +++ b/src/creaSystem.cxx @@ -44,8 +44,6 @@ namespace crea } #endif - - int System::GetAppPath(char *pname, size_t pathsize) { #ifdef LINUX @@ -166,10 +164,9 @@ int System::GetAppPath(char *pname, size_t pathsize) #endif /* MACOSX */ return -1; /* Path Lookup Failed */ -} - +} -std::string System::GetDllAppPath(std::string nomdll){ +std::string System::GetDllAppPath(std::string &nomdll){ std::string path = "."; #ifdef WIN32 char currentPath[_MAX_PATH]; @@ -183,8 +180,6 @@ std::string System::GetDllAppPath(std::string nomdll){ return path; } - - #if defined(_WIN32) #define CREACONTOUR_VALID_FILE_SEPARATOR_CHAR '\\' #else @@ -201,7 +196,7 @@ std::string System::GetExecutablePath(){ printf("Could not determine current executable path ? "); } // remove the exe name - char *slash; + char *slash; slash = strrchr(name, CREACONTOUR_VALID_FILE_SEPARATOR_CHAR); if (slash) { @@ -209,7 +204,5 @@ std::string System::GetExecutablePath(){ } return name; } - - - + } // namespace crea diff --git a/src/creaSystem.h b/src/creaSystem.h index f16ccbc..3e1142b 100644 --- a/src/creaSystem.h +++ b/src/creaSystem.h @@ -3,8 +3,8 @@ Program: crea Module: $RCSfile: creaSystem.h,v $ Language: C++ - Date: $Date: 2010/03/22 19:11:47 $ - Version: $Revision: 1.9 $ + Date: $Date: 2010/04/01 11:05:21 $ + Version: $Revision: 1.10 $ Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de l'Image). All rights reserved. See Doc/License.txt or @@ -28,8 +28,6 @@ // We try for Visual 6..???? //#pragma warning( disable : 4786) - - //----------------------------------------------------------------------------- //This is needed when compiling in debug mode #ifdef _MSC_VER @@ -136,9 +134,6 @@ */ //----------------------------------------------------------------------------- - - - //----------------------------------------------------------------------------- // Version #include @@ -160,9 +155,6 @@ namespace crea } //----------------------------------------------------------------------------- - - - //----------------------------------------------------------------------------- /* #ifdef _WIN32 @@ -225,7 +217,7 @@ namespace crea /// returns true iff the program has a tty static int HasTTY(); CREA_EXPORT static int GetAppPath(char *pname, size_t pathsize); - CREA_EXPORT static std::string GetDllAppPath(std::string nomdll); + CREA_EXPORT static std::string GetDllAppPath(std::string &nomdll); CREA_EXPORT static std::string GetExecutablePath(); }; -- 2.45.1