Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/Actions/toPythonString.cpp

    r992839 r33e801  
    4141#include "LinearAlgebra/Vector.hpp"
    4242
     43#include "Parameters/Specifics/KeyValuePair.hpp"
     44
    4345template <>
    4446const std::string toPythonString( const boost::filesystem::path & _value)
     
    5254  std::stringstream output;
    5355  output << _value.getAtomicNumber();
     56  return output.str();
     57}
     58
     59template <>
     60const std::string toPythonString( const KeyValuePair & _value)
     61{
     62  std::stringstream output;
     63  const char semicolon(';');
     64  const size_t semicolon_pos = _value.find_last_of(semicolon, std::string::npos);
     65  const size_t final_equality_pos = _value.find('=', semicolon_pos);
     66  output << _value;
     67  if ((semicolon_pos == std::string::npos)
     68      || (final_equality_pos != std::string::npos))
     69    output << semicolon;
    5470  return output.str();
    5571}
Note: See TracChangeset for help on using the changeset viewer.