I seek more knowledge of ones mind again.
I have a C++ solution which uses the Boost libraries as the solution requires to work within a Linux enviroment. However my knowledge is within C# and C++ is a somewhat new area of mine which I’ve dived into.
I’m looking for an example use of how I could create a somewhat template and replace the values via regex?
Here’s an example of what I’m talking about:
<VirtualHost *:80>
ServerName {$1}.somedomain.com
ServerAlias {$1}
ServerAdmin mr.admin@somedomain.com
<Location />
DAV svn
SVNPath /some/dir/{$2}/{$3}/{$4}
AuthType Basic
AuthName "{$5}"
AuthUserFile /some/dir/{$2}/{$3}/{$4}/{$4}.users
Require valid-user
</Location>
</VirtualHost>
And a key of the values:
{ Already formatted, just require to be replaced with the $n’s }
$1 = sub domain alias (3 characters long)
$2 = is either "public" or "private"
$3 = a users username (no more than 25 characters)
$4 = the svn project name (no more than 30 characters and " " replaced with "_")
$5 = the actual repository name given by the user.
Ideally a function/method will be able to handle this so I can just pass say a repository object through then render it via that.
Many thanks,
Shaun
Actually, you don’t need the power of regular expressions, you can do with find/replace.
m_templateshould be a big string containing the whole template with linebreaks.