SlHelpers
Loading...
Searching...
No Matches
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
 Branch -> BranchProps mapping.

Public Member Functions

const BranchesMapmap () const noexcept
 Obtain whole branch map.
auto begin () const noexcept
 Obtain begin iterator of branches.
auto end () const noexcept
 Obtain end iterator of branches.
BranchesList filter (unsigned include=ANY, unsigned exclude=EXCLUDED) const
 Obtain BranchesList according to a filter specified by include and exclude.
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.
BranchesSet mergesClosure (std::string_view branch) const
 Closure of branches that the specified branch merges.

Static Public Member Functions

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

Detailed Description

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

Member Typedef Documentation

◆ BranchesMap

Initial value:
std::unordered_map<std::string, BranchProps, SlHelpers::String::Hash,
Equality test for string and string_view to be used in containers.
Definition String.h:250
Hash for string and string_view to be used in hashing containers.
Definition String.h:223
Properties of a branch stored in Branches.
Definition Branches.h:20

Branch -> BranchProps mapping.

Member Function Documentation

◆ begin()

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

Obtain begin iterator of branches.

Returns
Begin iterator.

◆ create() [1/2]

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

Download branches.conf and parse it into Branches.

Returns
Branches if successful or nullopt.

◆ create() [2/2]

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

◆ 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]

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.

◆ getBuildBranches() [2/2]

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.

◆ 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:
  • /home/abuild/rpmbuild/BUILD/slhelpers-20260428.f233ce9-build/slhelpers-20260428.f233ce9/include/kerncvs/Branches.h