Changeset 52 for sources/src/simplify_string.cc
- Timestamp:
- Jan 22, 2013, 4:23:22 PM (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
sources/src/simplify_string.cc
r27 r52 35 35 36 36 #include "simplify_string.h" 37 37 38 #ifdef HAVE_CONFIG_H 38 39 #include "config.h" … … 43 44 namespace sc_core { 44 45 46 45 47 // Truncate the name : delete "." 46 string& 47 simplify_name (const char *name, string &newname) 48 { 49 if (!name) { 50 newname = ""; 51 return newname; 52 } 53 newname = name; 54 string::size_type i = 0; 55 do { 56 i = newname.find ('.'); 57 if (i == -1) 58 break; 59 newname[i] = '_'; 60 } while (1); 61 return newname; 48 string & simplify_name (const char * name, string & newname) { 49 if (!name) { 50 newname = ""; 51 return newname; 52 } 53 newname = name; 54 string::size_type i = 0; 55 do { 56 i = newname.find ('.'); 57 if (i == -1) { 58 break; 59 } 60 newname[i] = '_'; 61 } while (1); 62 return newname; 62 63 } 63 64 64 65 } // end of sc_core namespace 65 66 67 /* 68 # Local Variables: 69 # tab-width: 4; 70 # c-basic-offset: 4; 71 # c-file-offsets:((innamespace . 0)(inline-open . 0)); 72 # indent-tabs-mode: nil; 73 # End: 74 # 75 # vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=4:softtabstop=4 76 */ 77
Note: See TracChangeset
for help on using the changeset viewer.