FOSSology  4.4.0
Open Source License Compliance by Open Source Software
FossologyUnicodeClean.hpp
Go to the documentation of this file.
1 /*
2  SPDX-FileCopyrightText: © 2019 Siemens AG
3  Author: Gaurav Mishra <mishra.gaurav@siemens.com>
4 
5  SPDX-License-Identifier: GPL-2.0-only
6 */
12 #ifndef UTILS_BACKUP_FOSSOLOGYDBMIGRATE_HPP_
13 #define UTILS_BACKUP_FOSSOLOGYDBMIGRATE_HPP_
14 
15 #include <iostream>
16 #include <fstream>
17 #include <vector>
18 #include <boost/program_options.hpp>
19 
20 #include "libfossUtils.hpp"
21 
25 #define MAX_BUFFER_LEN 1024
26 
32 {
33  private:
34  std::ifstream sourceFile;
35  std::ofstream destinationFile;
36  std::vector<icu::UnicodeString> buffer;
37  size_t bufferSize;
38  bool stopRead;
39 
40  const std::string dirtyRead();
41  void write(const icu::UnicodeString &output);
42  void flush();
43  public:
44  FossologyUnicodeClean(std::string &source, std::string &destination);
45  virtual ~FossologyUnicodeClean();
46  void startConvert();
47 };
48 
49 #endif /* UTILS_BACKUP_FOSSOLOGYDBMIGRATE_HPP_ */
FossologyUnicodeClean(std::string &source, std::string &destination)
const std::string dirtyRead()
void flush()
Flush the buffers and reset the internal buffer.
void write(const icu::UnicodeString &output)
Write the string to file/stream.
General utility functions for CPP.