1 #ifndef GAUDIALG_HBOOKNAME_H
2 #define GAUDIALG_HBOOKNAME_H 1
32 inline std::string dirHbookName
33 (
const std::string& addr ,
34 const int maxLen = 16 )
37 if( addr.empty() ) {
return std::string(); }
39 std::string old( addr );
41 if( 0 < maxLen && maxLen < (
int) old.size() )
43 std::string::iterator p1,p2;
46 while( old.end() != p1 )
51 std::bind2nd(std::not_equal_to<char>(),sep));
52 p2 = std::find( p1 , old.end() , sep ) ;
53 if( ( p2 - p1 ) <= (int) maxLen ) { p1 = p2 ; continue ; }
54 old.insert( p1 + maxLen , sep ) ;
67 #endif // GAUDIALG_HBOOKNAME_H