- Main Page
- Namespaces
- Classes
- Files

- File List
- File Members

gpopsecrets_unix.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 // gpopsecrets_unix.cpp
19 //
20
21 #include "gdef.h"
22 #include "gpop.h"
23 #include "gpopsecrets.h"
24 #include "gpath.h"
25
26 std::string GPop::Secrets::defaultPath()
27 {
28 std::string sysconfdir( G_SYSCONFDIR ) ;
29 if( sysconfdir.empty() )
30 sysconfdir = "/etc" ;
31
32 G::Path path( sysconfdir ) ;
33 path.pathAppend( "emailrelay.auth" ) ;
34 return path.str() ;
35 }
36
G::Path::str
std::string str() const
Returns the path string.
Definition: gpath.cpp:135
gpopsecrets.h
gpop.h
gpath.h
G::Path::pathAppend
void pathAppend(const std::string &tail)
Appends a filename to the path.
Definition: gpath.cpp:301
GPop::Secrets::path
std::string path() const
Returns the storage path.
Definition: gpopsecrets.cpp:53
G_SYSCONFDIR
#define G_SYSCONFDIR
Definition: gpop.h:30
GPop::Secrets::defaultPath
static std::string defaultPath()
Returns the default path.
Definition: gpopsecrets_unix.cpp:26
G::Path
A Path object represents a file system path.
Definition: gpath.h:44