Пример #1
0
bool CsvFile::writeToFile(const std::string& newFilename) const
{
    std::string filename = newFilename;
    if (filename.empty())
        filename = lastFileRead;
    std::string str;
    writeToString(str);
    return strlib::writeStringToFile(filename, str);
}
Пример #2
0
void AssemblyWriter::writeToFile(const utString& filename)
{
    utString out;

    writeToString(out);

    // ... and write it
    utFileStream fs;

    fs.open(filename.c_str(), utStream::SM_WRITE);

    if (fs.isOpen())
    {
        fs.write(out.c_str(), (int)out.size());

        fs.close();
    }
    else
    {
        LSError("Could not write to %s", filename.c_str());
    }
}
/**
 * Writes a string representation of the given regular expression into a file.
 * @param re The regular expression.
 * @param filename The path to the output file.
 * @author Daniel Dreibrodt
 */
void REReaderWriter::writeToFile(RegularExpression *re, const char *filename) {
	ofstream file(filename, std::ios_base::binary);
	file << writeToString(re);
	file.close();
}