MCPcopy Create free account
hub / github.com/ChaiScript/ChaiScript / set

Method set

unittests/catch.hpp:6103–6115  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

6101
6102 auto name() const -> std::string { return *m_name; }
6103 auto set( std::string const& newName ) -> ParserResult {
6104
6105 auto lastSlash = newName.find_last_of( "\\/" );
6106 auto filename = ( lastSlash == std::string::npos )
6107 ? newName
6108 : newName.substr( lastSlash+1 );
6109
6110 *m_name = filename;
6111 if( m_ref )
6112 return m_ref->setValue( filename );
6113 else
6114 return ParserResult::ok( ParseResultType::Matched );
6115 }
6116 };
6117
6118 class Arg : public ParserRefImpl<Arg> {

Callers 1

parseMethod · 0.80

Calls 2

substrMethod · 0.80
setValueMethod · 0.45

Tested by

no test coverage detected