FOSSology  3.2.0rc1
Open Source License Compliance by Open Source Software
FossologyUnicodeClean.hpp
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2019, Siemens AG
3  * Author: Gaurav Mishra <mishra.gaurav@siemens.com>
4  *
5  * This program is free software; you can redistribute it and/or
6  * modify it under the terms of the GNU General Public License
7  * version 2 as published by the Free Software Foundation.
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 along
15  * with this program; if not, write to the Free Software Foundation, Inc.,
16  * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
17  */
23 #ifndef UTILS_BACKUP_FOSSOLOGYDBMIGRATE_HPP_
24 #define UTILS_BACKUP_FOSSOLOGYDBMIGRATE_HPP_
25 
26 #include <iostream>
27 #include <fstream>
28 #include <vector>
29 #include <boost/program_options.hpp>
30 
31 #include "libfossUtils.hpp"
32 
36 #define MAX_BUFFER_LEN 1024
37 
43 {
44  private:
45  std::ifstream sourceFile;
46  std::ofstream destinationFile;
47  std::vector<icu::UnicodeString> buffer;
48  size_t bufferSize;
49  bool stopRead;
50 
51  const std::string dirtyRead();
52  void write(const icu::UnicodeString &output);
53  void flush();
54  public:
55  FossologyUnicodeClean(std::string &source, std::string &destination);
56  virtual ~FossologyUnicodeClean();
57  void startConvert();
58 };
59 
60 #endif /* UTILS_BACKUP_FOSSOLOGYDBMIGRATE_HPP_ */
void flush()
Flush the buffers and reset the internal buffer.
const std::string dirtyRead()
void write(const icu::UnicodeString &output)
Write the string to file/stream.
FossologyUnicodeClean(std::string &source, std::string &destination)
General utility functions for CPP.