Page Menu
Home
GnuPG
Search
Configure Global Search
Log In
Files
F34307123
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Size
4 KB
Subscribers
None
View Options
diff --git a/engineinfo.cpp b/engineinfo.cpp
index f36e9a37..ac88eaef 100644
--- a/engineinfo.cpp
+++ b/engineinfo.cpp
@@ -1,85 +1,92 @@
/*
engineinfo.h
Copyright (C) 2004 Klarälvdalens Datakonsult AB
This file is part of GPGME++.
GPGME++ is free software; you can redistribute it and/or
modify it under the terms of the GNU Library General Public
License as published by the Free Software Foundation; either
version 2 of the License, or (at your option) any later version.
GPGME++ is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Library General Public License for more details.
You should have received a copy of the GNU Library General Public License
along with GPGME++; see the file COPYING.LIB. If not, write to the
Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
Boston, MA 02110-1301, USA.
*/
#include "engineinfo.h"
#include "shared.h"
#include <gpgme.h>
class GpgME::EngineInfo::Private : public GpgME::Shared {
public:
Private( gpgme_engine_info_t engine=0 ) : Shared(), info( engine ) {}
~Private() { info = 0; }
gpgme_engine_info_t info;
};
GpgME::EngineInfo::EngineInfo() : d(0) {}
GpgME::EngineInfo::EngineInfo( gpgme_engine_info_t engine )
: d(0)
{
d = new Private( engine );
d->ref();
}
GpgME::EngineInfo::EngineInfo( const EngineInfo & other )
: d( other.d )
{
if ( d )
d->ref();
}
GpgME::EngineInfo::~EngineInfo() {
if ( d )
d->deref();
}
bool GpgME::EngineInfo::isNull() const {
return !d || !d->info;
}
GpgME::Context::Protocol GpgME::EngineInfo::protocol() const {
if ( isNull() )
return Context::Unknown;
switch( d->info->protocol ) {
case GPGME_PROTOCOL_OpenPGP: return Context::OpenPGP;
case GPGME_PROTOCOL_CMS: return Context::CMS;
default:
return Context::Unknown;
}
}
const char * GpgME::EngineInfo::fileName() const {
return isNull() ? 0 : d->info->file_name;
}
const char * GpgME::EngineInfo::version() const {
return isNull() ? 0 : d->info->version;
}
const char * GpgME::EngineInfo::requiredVersion() const {
return isNull() ? 0 : d->info->req_version;
}
+const char * GpgME::EngineInfo::homeDirectory() const {
+#ifdef HAVE_GPGME_ENGINE_INFO_T_HOME_DIR
+ return isNull() ? 0 : d->info->home_dir;
+#else
+ return 0;
+#endif
+}
diff --git a/engineinfo.h b/engineinfo.h
index 8dbdf88c..a7026cc5 100644
--- a/engineinfo.h
+++ b/engineinfo.h
@@ -1,66 +1,68 @@
/*
engineinfo.h
Copyright (C) 2004 Klarälvdalens Datakonsult AB
This file is part of GPGME++.
GPGME++ is free software; you can redistribute it and/or
modify it under the terms of the GNU Library General Public
License as published by the Free Software Foundation; either
version 2 of the License, or (at your option) any later version.
GPGME++ is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Library General Public License for more details.
You should have received a copy of the GNU Library General Public License
along with GPGME++; see the file COPYING.LIB. If not, write to the
Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
Boston, MA 02110-1301, USA.
*/
#ifndef __GPGMEPP_ENGINEINFO_H__
#define __GPGMEPP_ENGINEINFO_H__
#include <gpgme++/gpgmefw.h>
#include <gpgme++/context.h>
#include <gpgme++/gpgme++_export.h>
#include <algorithm>
namespace GpgME {
class GPGMEPP_EXPORT EngineInfo {
public:
EngineInfo();
explicit EngineInfo( gpgme_engine_info_t engine );
EngineInfo( const EngineInfo & other );
~EngineInfo();
const EngineInfo & operator=( EngineInfo other ) {
swap( other );
return *this;
}
void swap( EngineInfo & other ) {
using std::swap;
swap( this->d, other.d );
}
bool isNull() const;
Context::Protocol protocol() const;
const char * fileName() const;
const char * version() const;
const char * requiredVersion() const;
+ const char * homeDirectory() const;
+
private:
class Private;
Private * d;
};
}
GPGMEPP_MAKE_STD_SWAP_SPECIALIZATION( EngineInfo )
#endif // __GPGMEPP_ENGINEINFO_H__
File Metadata
Details
Attached
Mime Type
text/x-diff
Expires
Sun, Dec 28, 10:17 PM (1 d, 12 h)
Storage Engine
local-disk
Storage Format
Raw Data
Storage Handle
6e/4c/36015bbdb2f7ea216619019e1e40
Attached To
rGPGMEPP Gpgme plus plus
Event Timeline
Log In to Comment