Bayeux  3.4.1
Core Foundation library for SuperNEMO
Classes | Public Member Functions | Static Public Member Functions | Static Public Attributes | Friends | List of all members
datatools::version_id Class Reference

A class representing a version ID : More...

#include <bayeux/datatools/version_id.h>

Inheritance diagram for datatools::version_id:
datatools::i_serializable

Classes

struct  tags
 

Public Member Functions

 version_id ()
 
 version_id (const std::string &tag_)
 
 version_id (int major_, int minor_=-1, int revision_=-1, const std::string &tag_="")
 
bool is_valid () const
 
bool has_numbers_only () const
 
void reset ()
 
bool has_major () const
 
bool has_major_only () const
 
int get_major () const
 
void set_major (int)
 
bool has_minor () const
 
int get_minor () const
 
void set_minor (int)
 
bool has_revision () const
 
int get_revision () const
 
void set_revision (int)
 
bool has_tag () const
 
bool has_tag_number () const
 
bool has_tag_only () const
 
bool has_numeric_tag () const
 
bool has_special_tag () const
 
const std::string & get_tag () const
 
int get_tag_number () const
 
void set_tag (const std::string &)
 
bool equals (const version_id &, bool ignore_tag_=false) const
 
bool operator== (const version_id &) const
 
int compare (const version_id &, bool major_only_=false) const
 
bool matches (const std::string &version_rules_, bool major_only_=false) const
 
void to_string (std::string &format_) const
 
std::string to_string () const
 
bool from_string (const std::string &)
 
void dump (std::ostream &out_=std::clog, const std::string &title_="", const std::string &indent_="") const
 
- Public Member Functions inherited from datatools::i_serializable
 i_serializable ()
 Default constructor. More...
 
virtual ~i_serializable ()
 Destructor. More...
 
virtual const std::string & get_serial_tag () const =0
 Return the serialization string identifier of the class. More...
 

Static Public Member Functions

static int compare (const version_id &vid0_, const version_id &vid1_, bool major_only=false)
 
static bool are_orderable (const version_id &vid0_, const version_id &vid1_, bool major_only_=false)
 
static const version_idinvalid ()
 Return an invalid version identifier. More...
 

Static Public Attributes

static const int32_t INVALID_NUMBER
 
static const char INVALID_SYMBOL
 
static const char NUMERIC_SEPARATOR
 
static const char TAG_SEPARATOR
 
static const int32_t MAX_RC_NUM
 
static const int32_t ALPHA_NUM
 
static const int32_t BETA_NUM
 
static const int32_t RC_BASE_NUM
 

Friends

std::ostream & operator<< (std::ostream &, const version_id &)
 
std::istream & operator>> (std::istream &, version_id &)
 

Detailed Description

A class representing a version ID :

Supported formats are:

Version ID objects can be relatively ordered unless :

Version ID objects can also be converted to and parsed from character strings.

Version ID can be checked to match version requirements (version rules) :

Examples :

Version ID can be invalidated : format is then "?"

Constructor & Destructor Documentation

◆ version_id() [1/3]

datatools::version_id::version_id ( )

◆ version_id() [2/3]

datatools::version_id::version_id ( const std::string &  tag_)
explicit

◆ version_id() [3/3]

datatools::version_id::version_id ( int  major_,
int  minor_ = -1,
int  revision_ = -1,
const std::string &  tag_ = "" 
)

Member Function Documentation

◆ are_orderable()

static bool datatools::version_id::are_orderable ( const version_id vid0_,
const version_id vid1_,
bool  major_only_ = false 
)
static

◆ compare() [1/2]

int datatools::version_id::compare ( const version_id ,
bool  major_only_ = false 
) const

◆ compare() [2/2]

static int datatools::version_id::compare ( const version_id vid0_,
const version_id vid1_,
bool  major_only = false 
)
static

◆ dump()

void datatools::version_id::dump ( std::ostream &  out_ = std::clog,
const std::string &  title_ = "",
const std::string &  indent_ = "" 
) const

◆ equals()

bool datatools::version_id::equals ( const version_id ,
bool  ignore_tag_ = false 
) const

◆ from_string()

bool datatools::version_id::from_string ( const std::string &  )

◆ get_major()

int datatools::version_id::get_major ( ) const

◆ get_minor()

int datatools::version_id::get_minor ( ) const

◆ get_revision()

int datatools::version_id::get_revision ( ) const

◆ get_tag()

const std::string& datatools::version_id::get_tag ( ) const

◆ get_tag_number()

int datatools::version_id::get_tag_number ( ) const

◆ has_major()

bool datatools::version_id::has_major ( ) const

◆ has_major_only()

bool datatools::version_id::has_major_only ( ) const

◆ has_minor()

bool datatools::version_id::has_minor ( ) const

◆ has_numbers_only()

bool datatools::version_id::has_numbers_only ( ) const

◆ has_numeric_tag()

bool datatools::version_id::has_numeric_tag ( ) const

◆ has_revision()

bool datatools::version_id::has_revision ( ) const

◆ has_special_tag()

bool datatools::version_id::has_special_tag ( ) const

◆ has_tag()

bool datatools::version_id::has_tag ( ) const

◆ has_tag_number()

bool datatools::version_id::has_tag_number ( ) const

◆ has_tag_only()

bool datatools::version_id::has_tag_only ( ) const

◆ invalid()

static const version_id& datatools::version_id::invalid ( )
static

Return an invalid version identifier.

◆ is_valid()

bool datatools::version_id::is_valid ( ) const

◆ matches()

bool datatools::version_id::matches ( const std::string &  version_rules_,
bool  major_only_ = false 
) const

◆ operator==()

bool datatools::version_id::operator== ( const version_id ) const

◆ reset()

void datatools::version_id::reset ( )

◆ set_major()

void datatools::version_id::set_major ( int  )

◆ set_minor()

void datatools::version_id::set_minor ( int  )

◆ set_revision()

void datatools::version_id::set_revision ( int  )

◆ set_tag()

void datatools::version_id::set_tag ( const std::string &  )

◆ to_string() [1/2]

void datatools::version_id::to_string ( std::string &  format_) const

◆ to_string() [2/2]

std::string datatools::version_id::to_string ( ) const

Friends And Related Function Documentation

◆ operator<<

std::ostream& operator<< ( std::ostream &  ,
const version_id  
)
friend

◆ operator>>

std::istream& operator>> ( std::istream &  ,
version_id  
)
friend

Member Data Documentation

◆ ALPHA_NUM

const int32_t datatools::version_id::ALPHA_NUM
static

◆ BETA_NUM

const int32_t datatools::version_id::BETA_NUM
static

◆ INVALID_NUMBER

const int32_t datatools::version_id::INVALID_NUMBER
static

◆ INVALID_SYMBOL

const char datatools::version_id::INVALID_SYMBOL
static

◆ MAX_RC_NUM

const int32_t datatools::version_id::MAX_RC_NUM
static

◆ NUMERIC_SEPARATOR

const char datatools::version_id::NUMERIC_SEPARATOR
static

◆ RC_BASE_NUM

const int32_t datatools::version_id::RC_BASE_NUM
static

◆ TAG_SEPARATOR

const char datatools::version_id::TAG_SEPARATOR
static

The documentation for this class was generated from the following file: