~chris-rogers/maus/1376

« back to all changes in this revision

Viewing changes to src/common_cpp/Utils/JsonWrapper.hh

  • Committer: Chris Rogers
  • Date: 2014-04-16 15:59:32 UTC
  • mfrom: (707.1.2 1413)
  • Revision ID: chris.rogers@stfc.ac.uk-20140416155932-u3rn5ielrc9o0jia
Fixes #1413

Show diffs side-by-side

added added

removed removed

Lines of Context:
123
123
   */
124
124
  Json::ValueType JsonTypeToValueType(const JsonType tp) throw(MAUS::Exception);
125
125
 
126
 
  /** @brief Return true if types are equal or anyValue
127
 
   */
128
 
  bool SimilarType(const JsonType jt1, const JsonType jt2);
 
126
  /** @brief Return true if cast_target can be cast to cast_type in a safe way
 
127
   *
 
128
   *  Return true if the target can be cast to cast_type without loss of data,
 
129
   *  i.e. int, uint can be cast to float; uint can be cast to int; anything can
 
130
   *  be cast to anyValue and we allow anyValue to be cast back to anything.
 
131
   */
 
132
  bool SimilarType(const JsonType cast_target, const JsonType cast_type);
 
133
 
 
134
  /** @brief Return true if types are numeric (integer or float)
 
135
   */
 
136
  bool IsNumeric(const JsonType jt);
 
137
 
129
138
 
130
139
  /** @brief Print the Json value to an ostream
131
140
   *