gsecrets_full.cpp
Go to the documentation of this file.
1 //
2 // Copyright (C) 2001-2013 Graeme Walker <graeme_walker@users.sourceforge.net>
3 //
4 // This program is free software: you can redistribute it and/or modify
5 // it under the terms of the GNU General Public License as published by
6 // the Free Software Foundation, either version 3 of the License, or
7 // (at your option) any later version.
8 //
9 // This program is distributed in the hope that it will be useful,
10 // but WITHOUT ANY WARRANTY; without even the implied warranty of
11 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 // GNU General Public License for more details.
13 //
14 // You should have received a copy of the GNU General Public License
15 // along with this program. If not, see <http://www.gnu.org/licenses/>.
16 // ===
17 //
18 // gsecrets_full.cpp
19 //
20 
21 #include "gdef.h"
22 #include "gauth.h"
23 #include "gsecrets.h"
24 #include "gsecretsfile.h"
25 
26 GAuth::Secrets::Secrets( const std::string & path , const std::string & name , const std::string & type ) :
27  m_source(path) ,
28  m_imp(new SecretsFile(path,true,name,type))
29 {
30 }
31 
33  m_imp(new SecretsFile(std::string(),true,std::string(),std::string()))
34 {
35 }
36 
38 {
39  delete m_imp ;
40 }
41 
42 std::string GAuth::Secrets::source() const
43 {
44  return m_source ;
45 }
46 
48 {
49  return m_imp->valid() ;
50 }
51 
52 std::string GAuth::Secrets::id( const std::string & mechanism ) const
53 {
54  return m_imp->id( mechanism ) ;
55 }
56 
57 std::string GAuth::Secrets::secret( const std::string & mechanism ) const
58 {
59  return m_imp->secret( mechanism ) ;
60 }
61 
62 std::string GAuth::Secrets::secret( const std::string & mechanism , const std::string & id ) const
63 {
64  return m_imp->secret( mechanism , id ) ;
65 }
66 
67 bool GAuth::Secrets::contains( const std::string & mechanism ) const
68 {
69  return m_imp->contains( mechanism ) ;
70 }
71 
virtual std::string secret(const std::string &mechanism) const
Final override from GAuth::SaslClient::Secrets.
virtual std::string id(const std::string &mechanism) const
Final override from GAuth::SaslClient::Secrets.
Secrets()
Default constructor for an in-valid(), empty-path object.
virtual bool valid() const
Final override from GAuth::Valid virtual base.
A implementation class used by GAuth::Secrets.
Definition: gsecretsfile.h:42
virtual ~Secrets()
Destructor.
virtual std::string source() const
Final override from GAuth::SaslServer::Secrets.
virtual bool contains(const std::string &mechanism) const
Final override from GAuth::SaslServer::Secrets.