|
|
1.1 root 1: /* 1.1.1.6 ! root 2: Copyright (c) 2008 TrueCrypt Developers Association. All rights reserved. 1.1 root 3: 1.1.1.6 ! root 4: Governed by the TrueCrypt License 2.8 the full text of which is contained in ! 5: the file License.txt included in TrueCrypt binary and source code distribution ! 6: packages. 1.1 root 7: */ 8: 9: #include "TextReader.h" 10: 11: namespace TrueCrypt 12: { 13: TextReader::TextReader (const FilePath &path) 14: { 15: InputFile.reset (new File); 16: InputFile->Open (path); 17: InputStream = shared_ptr <Stream> (new FileStream (InputFile)); 18: } 19: 20: bool TextReader::ReadLine (string &outputString) 21: { 22: outputString.erase(); 23: 24: char c; 25: while (InputStream->Read (BufferPtr ((byte *) &c, sizeof (c))) == sizeof (c)) 26: { 27: if (c == '\r') 28: continue; 29: 30: if (c == '\n') 31: return true; 32: 33: outputString += c; 34: } 35: return !outputString.empty(); 36: } 37: }
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.