OpenAB  1.0.1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
File.hpp
Go to the documentation of this file.
1 /*
2  * This Source Code Form is subject to the terms of the Mozilla Public
3  * License, v. 2.0. If a copy of the MPL was not distributed with this
4  * file, You can obtain one at http://mozilla.org/MPL/2.0/.
5  */
10 #ifndef FILE_HPP_
11 #define FILE_HPP_
12 
13 #include <plugin/source/Source.hpp>
14 #include <fstream>
15 #include <iostream>
16 
39 {
40  public:
44  FileSource(const std::string& f);
45 
49  virtual ~FileSource();
50 
52 
54 
56 
58 
60 
61  int getTotalCount() const;
62 
63  private:
67  FileSource(FileSource const &other);
68 
72  FileSource& operator=(FileSource const &other);
73 
74  std::string path;
75  std::ifstream infile;
76  std::vector<std::string> filenames;
77  int totalNumberOfVCards;
78  std::vector<std::string>::iterator currentFile;
79 };
80 
81 #endif // FILE_HPP_
int getTotalCount() const
Returns total count of items available from Source, if such information is available.
Definition: File.cpp:201
eCancelRet
Definition: Source.hpp:138
eResumeRet
Definition: Source.hpp:123
enum OpenAB_Source::Source::eResumeRet resume()
Resumes Source, if such operation is supported.
Definition: File.cpp:191
enum OpenAB_Source::Source::eInit init()
Initializes Source.
Definition: File.cpp:37
virtual ~FileSource()
Destructor, virtual by default.
Definition: File.cpp:28
eSuspendRet
Definition: Source.hpp:108
enum OpenAB_Source::Source::eGetItemRet getItem(OpenAB::SmartPtr< OpenAB::PIMItem > &item)
Gets PIM Item from Source. If Source is suspended getItem() should block until Source will be resumed...
Definition: File.cpp:134
Documentation for Source plugin interface.
Definition: Source.hpp:76
enum OpenAB_Source::Source::eCancelRet cancel()
Cancels Source, if such operation is supported. After canceling Source next call to getVCard() should...
Definition: File.cpp:196
eGetItemRet
Definition: Source.hpp:155
enum OpenAB_Source::Source::eSuspendRet suspend()
Suspends Source, if such operation is supported.
Definition: File.cpp:186
Documentation for class File.
Definition: File.hpp:38
eInit
Definition: Source.hpp:94
FileSource(const std::string &f)
Constructor.
Definition: File.cpp:20