1/*
2 defaultassuantransaction.h - default Assuan Transaction that just stores data and status lines
3 Copyright (C) 2009 Klarälvdalens Datakonsult AB
4
5 This file is part of GPGME++.
6
7 GPGME++ is free software; you can redistribute it and/or
8 modify it under the terms of the GNU Library General Public
9 License as published by the Free Software Foundation; either
10 version 2 of the License, or (at your option) any later version.
11
12 GPGME++ is distributed in the hope that it will be useful,
13 but WITHOUT ANY WARRANTY; without even the implied warranty of
14 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 GNU Library General Public License for more details.
16
17 You should have received a copy of the GNU Library General Public License
18 along with GPGME++; see the file COPYING.LIB. If not, write to the
19 Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
20 Boston, MA 02110-1301, USA.
21*/
22
23#ifndef __GPGMEPP_DEFAULTASSUANTRANSACTION_H__
24#define __GPGMEPP_DEFAULTASSUANTRANSACTION_H__
25
26#include <gpgme++/interfaces/assuantransaction.h>
27
28#include <string>
29#include <vector>
30#include <utility>
31
32namespace GpgME {
33
34 class GPGMEPP_EXPORT DefaultAssuanTransaction : public AssuanTransaction {
35 public:
36 explicit DefaultAssuanTransaction();
37 ~DefaultAssuanTransaction();
38
39 const std::vector< std::pair<std::string,std::string> > & statusLines() const {
40 return m_status;
41 }
42 std::vector<std::string> statusLine( const char * tag ) const;
43 std::string firstStatusLine( const char * tag ) const;
44
45 const std::string & data() const {
46 return m_data;
47 }
48
49 private:
50 /* reimp */ Error data( const char * data, size_t datalen );
51 /* reimp */ Data inquire( const char * name, const char * args, Error & err );
52 /* reimp */ Error status( const char * status, const char * args );
53
54 private:
55 std::vector< std::pair<std::string,std::string> > m_status;
56 std::string m_data;
57 };
58
59} // namespace GpgME
60
61#endif // __GPGMEPP_DEFAULTASSUANTRANSACTION_H__
62