Changeset 790d835
- Timestamp:
- Nov 7, 2023, 3:38:01 PM (14 months ago)
- Branches:
- master
- Children:
- c6b4432
- Parents:
- 934fa0f
- Location:
- src/Common
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
src/Common/UniqueName.cc
r934fa0f r790d835 5 5 // file "LICENCE" distributed with Cforall. 6 6 // 7 // UniqueName.cc -- 7 // UniqueName.cc -- Create a unique variants of a base name with a counter. 8 8 // 9 9 // Author : Richard C. Bilson 10 10 // Created On : Mon May 18 07:44:20 2015 11 // Last Modified By : Peter A. Buhr12 // Last Modified On : Mon Jun 8 14:47:49 201513 // Update Count : 311 // Last Modified By : Andrew Beach 12 // Last Modified On : Tue Nov 7 15:04:00 2023 13 // Update Count : 4 14 14 // 15 15 16 #include <string> 17 #include <sstream> 16 #include "UniqueName.h" 18 17 19 #include " UniqueName.h"18 #include "Common/ToString.hpp" 20 19 21 20 UniqueName::UniqueName( const std::string &base ) : base( base ), count( 0 ) { … … 23 22 24 23 std::string UniqueName::newName( const std::string &additional ) { 25 std::ostringstream os; 26 os << base << additional << count++; 27 return os.str(); 24 return toString( base, additional, count++ ); 28 25 } 29 26 -
src/Common/UniqueName.h
r934fa0f r790d835 5 5 // file "LICENCE" distributed with Cforall. 6 6 // 7 // UniqueName.h -- 7 // UniqueName.h -- Create a unique variants of a base name with a counter. 8 8 // 9 9 // Author : Richard C. Bilson 10 10 // Created On : Mon May 18 07:44:20 2015 11 // Last Modified By : Peter A. Buhr12 // Last Modified On : Fri Jul 21 22:18:45 201713 // Update Count : 211 // Last Modified By : Andrew Beach 12 // Last Modified On : Tue Nov 7 15:00:00 2023 13 // Update Count : 3 14 14 // 15 15 … … 19 19 20 20 class UniqueName { 21 22 UniqueName( const std::string &base = "");21 public: 22 UniqueName( const std::string &base ); 23 23 std::string newName( const std::string &additional = "" ); 24 24 private: 25 25 std::string base; 26 26 int count;
Note: See TracChangeset
for help on using the changeset viewer.