From Genome Analysis Wiki
Jump to navigationJump to search
506 bytes added
, 11:54, 20 May 2010
Line 14: |
Line 14: |
| Defaults to [[C++ Class: InputFile#ClassEnums|DEFAULT]] which determines the file type from the extension when opening a file for write. | | Defaults to [[C++ Class: InputFile#ClassEnums|DEFAULT]] which determines the file type from the extension when opening a file for write. |
| |} | | |} |
| + | |
| + | ==== Using the static methods ==== |
| + | Here is an example of using setWriteFileType (writes a glf as a standard file rather than in bgzf which would be the default): |
| + | <source lang="cpp"> |
| + | InputFile::setWriteFileType(InputFile::STD); |
| + | std::string filename = "results/stdFile.glf"; |
| + | assert(InputFile::openFile(filename.c_str(), "wt") == true); |
| + | assert(ifwrite(TEST_FILE_CONTENTS.c_str(), TEST_FILE_CONTENTS.length()) |
| + | == TEST_FILE_CONTENTS.length()); |
| + | assert(ifclose() == 0); |
| + | </source> |
| | | |
| | | |