14 #include <zypp/base/Logger.h> 17 #include <zypp/PathInfo.h> 23 #undef ZYPP_BASE_LOGGER_LOGGROUP 24 #define ZYPP_BASE_LOGGER_LOGGROUP "parser" 55 struct StopParsing {};
57 CredentialFileReaderImpl(
const Pathname & input_r,
const ProcessCredentials & callback_r )
73 virtual void beginParse()
77 virtual void consume(
const std::string & section_r )
87 ERR <<
"Ignore invalid URL '" << section_r <<
"' in file " <<
_input << endl;
92 virtual void consume(
const std::string & section_r,
const std::string & key_r,
const std::string & value_r )
94 if ( !
_secret && section_r.empty() )
99 if ( key_r ==
"username" )
100 _secret->setUsername( value_r );
101 else if ( key_r ==
"password" )
102 _secret->setPassword( value_r );
104 WAR <<
"Ignore unknown attribute '" << key_r <<
"=" << value_r <<
"' in file " <<
_input << endl;
110 virtual void endParse()
118 throw( StopParsing() );
121 ERR <<
"Ignore invalid credentials for URL '" <<
_secret->url() <<
"' in file " <<
_input << endl;
141 { CredentialFileReaderImpl( crfile_r, callback_r ); }
Base class for all URL exceptions.
const ProcessCredentials & _callback
Wrapper class for ::stat/::lstat.
Easy-to use interface to the ZYPP dependency resolver.