SlHelpers
SlKernCVS::Branches Class Reference

Parse branches.conf into a map of branch -> properties (BranchProps) More...

#include <Branches.h>

Public Types

enum  Filter : unsigned { BUILD = 1U << 0, PUBLISH = 1U << 1, EXCLUDED = 1U << 2, ANY = ~0U }
 Constants used for filter()
 
using BranchesSet = std::unordered_set< std::string >
 A set of branches.
 
using BranchesList = BranchProps::BranchesList
 A list of branches.
 
using BranchesMap = std::unordered_map< std::string, BranchProps, SlHelpers::String::Hash, SlHelpers::String::Eq >
 Branch -> BranchProps mapping.
 

Public Member Functions

const BranchesMapmap () const noexcept
 Obtain whole branch map. More...
 
auto begin () const noexcept
 Obtain begin iterator of branches. More...
 
auto end () const noexcept
 Obtain end iterator of branches. More...
 
BranchesList filter (unsigned include=ANY, unsigned exclude=EXCLUDED) const
 Obtain BranchesList according to a filter specified by include and exclude. More...
 
const BranchPropsprops (std::string_view branch) const
 Return BranchProps for branch.
 
const BranchesListmerges (std::string_view branch) const
 Immediate branches that the specified branch merges. More...
 
BranchesSet mergesClosure (std::string_view branch) const
 Closure of branches that the specified branch merges. More...
 

Static Public Member Functions

static Branches create (std::string_view branchesConf) noexcept
 Parse provided branchesConf into Branches. More...
 
static std::optional< Branchescreate ()
 Download branches.conf and parse it into Branches. More...
 
static BranchesList getBuildBranches (std::string_view branchesConf) noexcept
 Convert branchesConf to a list of branches which are built. More...
 
static std::optional< BranchesListgetBuildBranches ()
 Download branches.conf and convert it to a list of branches which are built. More...
 

Detailed Description

Parse branches.conf into a map of branch -> properties (BranchProps)

Member Function Documentation

◆ begin()

auto SlKernCVS::Branches::begin ( ) const
inlinenoexcept

Obtain begin iterator of branches.

Returns
Begin iterator.

◆ create() [1/2]

static Branches SlKernCVS::Branches::create ( std::string_view  branchesConf)
staticnoexcept

Parse provided branchesConf into Branches.

Parameters
branchesConfbranches.conf content to parse
Returns
Branches parsed from branchesConf

◆ create() [2/2]

static std::optional<Branches> SlKernCVS::Branches::create ( )
static

Download branches.conf and parse it into Branches.

Returns
Branches if successful or nullopt.

◆ end()

auto SlKernCVS::Branches::end ( ) const
inlinenoexcept

Obtain end iterator of branches.

Returns
End iterator.

◆ filter()

BranchesList SlKernCVS::Branches::filter ( unsigned  include = ANY,
unsigned  exclude = EXCLUDED 
) const

Obtain BranchesList according to a filter specified by include and exclude.

Parameters
includeProperties of branches to include in the output
excludeProperties of branches to exclude from the output
Returns
BranchesList according to the specified filter

◆ getBuildBranches() [1/2]

static BranchesList SlKernCVS::Branches::getBuildBranches ( std::string_view  branchesConf)
staticnoexcept

Convert branchesConf to a list of branches which are built.

Parameters
branchesConfbranches.conf to parse
Returns
List of built branches.

◆ getBuildBranches() [2/2]

static std::optional<BranchesList> SlKernCVS::Branches::getBuildBranches ( )
static

Download branches.conf and convert it to a list of branches which are built.

Returns
List of built branches.

◆ map()

const BranchesMap& SlKernCVS::Branches::map ( ) const
inlinenoexcept

Obtain whole branch map.

Returns
Branch mapping.

◆ merges()

const BranchesList& SlKernCVS::Branches::merges ( std::string_view  branch) const
inline

Immediate branches that the specified branch merges.

Parameters
branchBranch to find children of
Returns
BranchesList of branches merged into branch.

◆ mergesClosure()

BranchesSet SlKernCVS::Branches::mergesClosure ( std::string_view  branch) const

Closure of branches that the specified branch merges.

Parameters
branchBranch to find children of
Returns
Transitive BranchesSet of branches merged into branch.

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