FOSSology
4.4.0
Open Source License Compliance by Open Source Software
|
#include <FossologyUnicodeClean.hpp>
Public Member Functions | |
FossologyUnicodeClean (std::string &source, std::string &destination) | |
virtual | ~FossologyUnicodeClean () |
void | startConvert () |
Private Member Functions | |
const std::string | dirtyRead () |
void | write (const icu::UnicodeString &output) |
Write the string to file/stream. More... | |
void | flush () |
Flush the buffers and reset the internal buffer. More... | |
Private Attributes | |
std::ifstream | sourceFile |
std::ofstream | destinationFile |
std::vector< icu::UnicodeString > | buffer |
size_t | bufferSize |
bool | stopRead |
Class to remove non UTF-8 characters from file or steam and dump to another file or stream
Definition at line 31 of file FossologyUnicodeClean.hpp.
FossologyUnicodeClean::FossologyUnicodeClean | ( | std::string & | source, |
std::string & | destination | ||
) |
Constructor to open the input and output files (if passed). Also reserve the buffer in internal vector
source | Source file path (STDIN if empty) |
destination | Destination file path (STDOUT if empty) |
Definition at line 34 of file FossologyUnicodeClean.cc.
|
virtual |
Destructor to flush the streams and close any open files.
Definition at line 15 of file FossologyUnicodeClean.cc.
|
private |
Read raw input from file or STDIN
Definition at line 89 of file FossologyUnicodeClean.cc.
|
private |
Flush the buffers and reset the internal buffer.
Print the content of internal buffer to appropriate streams and flush them. Then clear the internal buffer and reset the size.
Definition at line 131 of file FossologyUnicodeClean.cc.
void FossologyUnicodeClean::startConvert | ( | ) |
Start the process to read from file/stream -> remove invalid chars -> print to file/stream.
Definition at line 72 of file FossologyUnicodeClean.cc.
|
private |
Write the string to file/stream.
output |
Definition at line 115 of file FossologyUnicodeClean.cc.