//////////////////////////////////////////////////////////////////////////////// /*! @file Version.h Source code version identification. - Part of RANet - Research Assistant Net Library. - Copyright(C) 2010-2015, Viktor E. Bursian, St.Petersburg, Russia. Viktor.Bursian@mail.ioffe.ru */////////////////////////////////////////////////////////////////////////////// #ifndef Version_H #define Version_H #include "Strings.h" namespace RA { //------------------------------------------------------------------------------ ANNOUNCE_CLASS(sVersion) //------------------------------------------------------------------------------ namespace RANet { RANet_EXPORT extern sVersion const Version; } //----------------------------------------------------------------- sVersion --- /*! Source code version identification. @todo{version} додумать и причесать, сейчас удобно, но странно: sVerion("") != sVersion(); sVerion(1,5) == sVersion(1,5,-9,0); sVerion(1,5,"0-alpha") > sVersion(1,5); sVerion(1,5,"0-alpha") < sVersion(1,5,0). */ class RANet_EXPORT sVersion { public: sVersion (sString text); sVersion (int major_part ,int minor_part ,rcsString patch_and_stage ,rcsString build_date); sVersion (); sVersion (int major_part ,int minor_part); sVersion (int major_part ,int minor_part ,int patch_part ,int stage_part = 0); public: sVersion (rcsVersion other); rsVersion operator = (rcsVersion other); sVersion Principal () const { return sVersion(Major,Minor); } sVersion Valuable () const { return sVersion(Major,Minor,Patch,Stage); } sString Text () const; bool IsValid () const; bool IsValidAndNumeric () const; public: bool operator == (rcsVersion) const; bool operator < (rcsVersion) const; bool operator <= (rcsVersion) const; bool operator > (rcsVersion) const; bool operator >= (rcsVersion) const; public://fields int Major; int Minor; int Patch; int Stage;//!< development stage //!< -9 - undefined, //!< -2 - alpha, //!< -1 - beta, //!< 0 - release. sString BuildDate; private: void ParsePatchAndStage (rcsString patch_and_stage); }; //------------------------------------------------------------------------------ } //namespace RA #endif