libDwm-0.9.45
Dwm::SvnTag Class Reference

Trivial class used to fetch an assumed SVN tag name from a repository path (in a Subversion keyword). More...

#include <DwmSvnTag.hh>

Public Member Functions

 SvnTag (const std::string &keyword)
 Construct from a Header keyword substitution or any custom keyword substition that includes P or u.
 
std::string TagName (const std::string &tagRegex=R"(\/tags\/([^\/]+))", const std::string &branchRegex=R"(\/branches\/([^\/]+))", const std::string &trunkRegex=R"(\/(trunk)\/)") const
 Fetches the SVN tag name using a regular expression tagRegex.
 
std::string FileName () const
 Returns the file name.
 

Detailed Description

Trivial class used to fetch an assumed SVN tag name from a repository path (in a Subversion keyword).

Member Function Documentation

◆ FileName()

std::string Dwm::SvnTag::FileName ( ) const

Returns the file name.

This is shortened a bit to try to remove some of the path to the repository.

◆ TagName()

std::string Dwm::SvnTag::TagName ( const std::string & tagRegex = R"(\/tags\/([^\/]+))",
const std::string & branchRegex = R"(\/branches\/([^\/]+))",
const std::string & trunkRegex = R"(\/(trunk)\/)" ) const

Fetches the SVN tag name using a regular expression tagRegex.

The default regular expression covers the typical case where a tagged version of software is under a 'tags' directory in the repository. Ditto for fetching a branch name using the regular expression branchRegex or the trunk using trunkRegex. When the working copy is on a branch, we will add " (branch)" to the end of the name to distinguish it from a tag with the same name. When the working copy is the trunk, we will add " (revnum)" to the end of the name, where revnum is the revision number of the file's last modification. We can only add the revnum if the keyword in the constructor included Header, Id, Revision or a custom keyword substitution whose 3rd word was the revision. For example, "$DwmPath: dwm/libDwm/trunk/include/DwmSvnTag.hh 11210 $".


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