Example #1
0
position::position(const file& source, size_t line, size_t col, size_t index) : source_(&source), line_(line), col_(col), index_(index) {
    assert(line >= 1);
    assert(col >= 1);
    if (index > source.length()) {
        throw std::logic_error("position (" + std::to_string(index) + ") is out of range (" + std::to_string(source.length()) + ")");
    }
}
Example #2
0
void decryptContent(file & someFile, key & someKey, vector<string> & decryptedContent)
{
    unsigned int fileLen = someFile.length();
    for (unsigned int i = 0; i < fileLen; i++)
    {
        string output = "";
        for (unsigned int j = 0; j < someFile[i].length(); j++)
        {
            output.push_back(decryptChar(someFile[i][j], someKey));
        }
        decryptedContent.push_back(output);
    }
}