Geant4 Cross Reference |
1 // Copyright (C) 2010, Guy Barrand. All rights 1 // Copyright (C) 2010, Guy Barrand. All rights reserved. 2 // See the file tools.license for terms. 2 // See the file tools.license for terms. 3 3 4 #ifndef tools_long_out 4 #ifndef tools_long_out 5 #define tools_long_out 5 #define tools_long_out 6 6 7 #include "snpf" 7 #include "snpf" 8 #include <string> 8 #include <string> 9 9 10 namespace tools { 10 namespace tools { 11 11 12 class long_out : public std::string { 12 class long_out : public std::string { 13 typedef std::string parent; 13 typedef std::string parent; 14 public: 14 public: 15 long_out(long a_value) { 15 long_out(long a_value) { 16 char _s[512]; 16 char _s[512]; 17 snpf(_s,sizeof(_s),"%ld",a_value); 17 snpf(_s,sizeof(_s),"%ld",a_value); 18 parent::operator+=(_s); 18 parent::operator+=(_s); 19 } 19 } 20 public: 20 public: 21 long_out(const long_out& a_from):parent(a_fr 21 long_out(const long_out& a_from):parent(a_from){} 22 long_out& operator=(const long_out& a_from){ 22 long_out& operator=(const long_out& a_from){parent::operator=(a_from);return *this;} 23 }; 23 }; 24 24 25 } 25 } 26 26 27 #endif 27 #endif