io.hpp 2.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. // Boost.Units - A C++ library for zero-overhead dimensional analysis and
  2. // unit/quantity manipulation and conversion
  3. //
  4. // Copyright (C) 2003-2008 Matthias Christian Schabel
  5. // Copyright (C) 2008 Steven Watanabe
  6. //
  7. // Distributed under the Boost Software License, Version 1.0. (See
  8. // accompanying file LICENSE_1_0.txt or copy at
  9. // http://www.boost.org/LICENSE_1_0.txt)
  10. #ifndef BOOST_UNITS_CGS_IO_HPP
  11. #define BOOST_UNITS_CGS_IO_HPP
  12. #include <boost/units/io.hpp>
  13. #include <boost/units/reduce_unit.hpp>
  14. #include <boost/units/systems/cgs.hpp>
  15. namespace boost {
  16. namespace units {
  17. inline std::string name_string(const reduce_unit<cgs::acceleration>::type&) { return "galileo"; }
  18. inline std::string symbol_string(const reduce_unit<cgs::acceleration>::type&) { return "Gal"; }
  19. inline std::string name_string(const reduce_unit<cgs::current>::type&) { return "biot"; }
  20. inline std::string symbol_string(const reduce_unit<cgs::current>::type&) { return "Bi"; }
  21. inline std::string name_string(const reduce_unit<cgs::dynamic_viscosity>::type&) { return "poise"; }
  22. inline std::string symbol_string(const reduce_unit<cgs::dynamic_viscosity>::type&) { return "P"; }
  23. inline std::string name_string(const reduce_unit<cgs::energy>::type&) { return "erg"; }
  24. inline std::string symbol_string(const reduce_unit<cgs::energy>::type&) { return "erg"; }
  25. inline std::string name_string(const reduce_unit<cgs::force>::type&) { return "dyne"; }
  26. inline std::string symbol_string(const reduce_unit<cgs::force>::type&) { return "dyn"; }
  27. inline std::string name_string(const reduce_unit<cgs::kinematic_viscosity>::type&) { return "stoke"; }
  28. inline std::string symbol_string(const reduce_unit<cgs::kinematic_viscosity>::type&) { return "St"; }
  29. inline std::string name_string(const reduce_unit<cgs::pressure>::type&) { return "barye"; }
  30. inline std::string symbol_string(const reduce_unit<cgs::pressure>::type&) { return "Ba"; }
  31. inline std::string name_string(const reduce_unit<cgs::wavenumber>::type&) { return "kayser"; }
  32. inline std::string symbol_string(const reduce_unit<cgs::wavenumber>::type&) { return "K"; }
  33. } // namespace units
  34. } // namespace boost
  35. #endif // BOOST_UNITS_CGS_IO_HPP