From OpenSCADAWiki
Jump to: navigation, search

Short calls for global functions into "OSCADA" namespace:

  • template <class fVal> fVal fmin( fVal a, fVal b ); template <class fVal> fVal fmax( fVal a, fVal b ); — functional templates for obtain of two values minimum and maximum.
  • inline string i2s( int val, TSYS::IntView view = TSYS::Dec ) —> TSYS::int2str(val, view);
  • inline string u2s( unsigned val, TSYS::IntView view = TSYS::Dec ) —> TSYS::uint2str(val, view);
  • inline string ll2s( long long val, TSYS::IntView view = TSYS::Dec ) —> TSYS::ll2str(val, view);
  • inline string r2s( double val, int prec = 15, char tp = 'g' ) —> TSYS::real2str(val, prec, tp);
  • inline double rRnd( double val, int dig = 0, bool toint = false ) —> TSYS::realRound(val, dig, toint);
  • inline string atm2s( time_t tm, const string &format = "", bool gmt = false ) —> TSYS::atime2str(tm, format, gmt);
  • inline string tm2s( double tm ) —> TSYS::time2str(tm);
  • inline int s2i( const string &val ) —> atoi(val.c_str());
  • inline long s2l( const string &val, int base = 10 ) —> strtol(val.c_str(), NULL, base);
  • inline unsigned long s2u( const string &val, int base = 10 ) —> strtoul(val.c_str(), NULL, base);
  • inline long long s2ll( const string &val ) —> atoll(val.c_str());
  • inline double s2r( const string &val ) — TSYS::str2real(val);
  • inline string sTrm( const string &val, const string &cfg = " \n\t\r") —> TSYS::strTrim(val, cfg);