CMS 3D CMS Logo

Public Member Functions | Private Attributes

edm::releaseversion::DecomposedReleaseVersion Class Reference

#include <ReleaseVersion.h>

List of all members.

Public Member Functions

 DecomposedReleaseVersion (std::string releaseVersion)
bool operator< (DecomposedReleaseVersion const &other) const

Private Attributes

bool irregular_
unsigned int major_
unsigned int minor_

Detailed Description

Definition at line 9 of file ReleaseVersion.h.


Constructor & Destructor Documentation

edm::releaseversion::DecomposedReleaseVersion::DecomposedReleaseVersion ( std::string  releaseVersion) [explicit]

Definition at line 26 of file ReleaseVersion.cc.

References exception, irregular_, major_, minor_, CfgNavigationSchool_cfi::parts, and edm::split().

                                                                               : irregular_(true), major_(0), minor_(0)/*, point_(0), patch_(0), pre_(0)*/ {
      try {
        std::vector<std::string> parts;
        parts.reserve(releaseVersion.size());
        boost::algorithm::split(parts, releaseVersion, IsNotDigit(), boost::algorithm::token_compress_on);
        parts.erase(remove_if(parts.begin(), parts.end(), IsEmpty()), parts.end());

        if(parts.size() < 3) {
          return;
        }
/*
        if(parts.size() == 4) {
          if(releaseVersion.find("patch") != std::string::npos) {
            patch_ = boost::lexical_cast<unsigned int>(parts[3]);
          } else if(releaseVersion.find("pre") != std::string::npos) {
            pre_ = boost::lexical_cast<unsigned int>(parts[3]);
          } else {
            return;
          }
        }
*/
        major_ = boost::lexical_cast<unsigned int>(parts[0]);
        minor_ = boost::lexical_cast<unsigned int>(parts[1]);
//        point_ = boost::lexical_cast<unsigned int>(parts[2]);
        irregular_ = false;
      } catch(std::exception const&) {
      }
    }

Member Function Documentation

bool edm::releaseversion::DecomposedReleaseVersion::operator< ( DecomposedReleaseVersion const &  other) const

Definition at line 56 of file ReleaseVersion.cc.

References irregular_, major_, and minor_.

                                                                                        {
      if(irregular_ || other.irregular_) return false;
      if(major_ < other.major_) return true;
      if(major_ > other.major_) return false;
      if(minor_ < other.minor_) return true;
//      if(minor_ > other.minor_) return false;
//      if(point_ < other.point_) return true;
//      if(point_ > other.point_) return false;
//      if(patch_ < other.patch_) return true;
//      if(patch_ > other.patch_) return false;
//      if(pre_ < other.pre_) return true;
      return false;
    }

Member Data Documentation

Definition at line 14 of file ReleaseVersion.h.

Referenced by DecomposedReleaseVersion(), and operator<().

Definition at line 15 of file ReleaseVersion.h.

Referenced by DecomposedReleaseVersion(), and operator<().

Definition at line 16 of file ReleaseVersion.h.

Referenced by DecomposedReleaseVersion(), and operator<().