Crow  1.0
A C++ microframework for the web
crow::Blueprint Class Reference

A blueprint can be considered a smaller section of a Crow app, specifically where the router is conecerned. More...

Collaboration diagram for crow::Blueprint:

Public Member Functions

 Blueprint (const std::string &prefix)
 
 Blueprint (const std::string &prefix, const std::string &static_dir)
 
 Blueprint (const std::string &prefix, const std::string &static_dir, const std::string &templates_dir)
 
 Blueprint (Blueprint &&value)
 
Blueprintoperator= (const Blueprint &value)=delete
 
Blueprintoperator= (Blueprint &&value) noexcept
 
bool operator== (const Blueprint &value)
 
bool operator!= (const Blueprint &value)
 
std::string prefix () const
 
std::string static_dir () const
 
DynamicRulenew_rule_dynamic (std::string &&rule)
 
template<uint64_t N>
black_magic::arguments< N >::type::template rebind< TaggedRule > & new_rule_tagged (std::string &&rule)
 
void register_blueprint (Blueprint &blueprint)
 
CatchallRulecatchall_rule ()
 

Private Member Functions

void apply_blueprint (Blueprint &blueprint)
 

Private Attributes

std::string prefix_
 
std::string static_dir_
 
std::string templates_dir_
 
std::vector< std::unique_ptr< BaseRule > > all_rules_
 
CatchallRule catchall_rule_
 
std::vector< Blueprint * > blueprints_
 

Friends

class Router
 

Detailed Description

A blueprint can be considered a smaller section of a Crow app, specifically where the router is conecerned.

You can use blueprints to assign a common prefix to rules' prefix, set custom static and template folders, and set a custom catchall route. You can also assign nest blueprints for maximum Compartmentalization.

Constructor & Destructor Documentation

◆ Blueprint() [1/4]

crow::Blueprint::Blueprint ( const std::string &  prefix)
inline

◆ Blueprint() [2/4]

crow::Blueprint::Blueprint ( const std::string &  prefix,
const std::string &  static_dir 
)
inline

◆ Blueprint() [3/4]

crow::Blueprint::Blueprint ( const std::string &  prefix,
const std::string &  static_dir,
const std::string &  templates_dir 
)
inline

◆ Blueprint() [4/4]

crow::Blueprint::Blueprint ( Blueprint &&  value)
inline

Member Function Documentation

◆ operator=() [1/2]

Blueprint& crow::Blueprint::operator= ( const Blueprint value)
delete

◆ operator=() [2/2]

Blueprint& crow::Blueprint::operator= ( Blueprint &&  value)
inlinenoexcept

◆ operator==()

bool crow::Blueprint::operator== ( const Blueprint value)
inline
Here is the call graph for this function:

◆ operator!=()

bool crow::Blueprint::operator!= ( const Blueprint value)
inline
Here is the call graph for this function:

◆ prefix()

std::string crow::Blueprint::prefix ( ) const
inline
Here is the caller graph for this function:

◆ static_dir()

std::string crow::Blueprint::static_dir ( ) const
inline

◆ new_rule_dynamic()

DynamicRule& crow::Blueprint::new_rule_dynamic ( std::string &&  rule)
inline

◆ new_rule_tagged()

template<uint64_t N>
black_magic::arguments<N>::type::template rebind<TaggedRule>& crow::Blueprint::new_rule_tagged ( std::string &&  rule)
inline

◆ register_blueprint()

void crow::Blueprint::register_blueprint ( Blueprint blueprint)
inline
Here is the call graph for this function:

◆ catchall_rule()

CatchallRule& crow::Blueprint::catchall_rule ( )
inline

◆ apply_blueprint()

void crow::Blueprint::apply_blueprint ( Blueprint blueprint)
inlineprivate
Here is the caller graph for this function:

Friends And Related Function Documentation

◆ Router

friend class Router
friend

Member Data Documentation

◆ prefix_

std::string crow::Blueprint::prefix_
private

◆ static_dir_

std::string crow::Blueprint::static_dir_
private

◆ templates_dir_

std::string crow::Blueprint::templates_dir_
private

◆ all_rules_

std::vector<std::unique_ptr<BaseRule> > crow::Blueprint::all_rules_
private

◆ catchall_rule_

CatchallRule crow::Blueprint::catchall_rule_
private

◆ blueprints_

std::vector<Blueprint*> crow::Blueprint::blueprints_
private

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