// // Copyright 2009 Illumina, Inc. // // This software is covered by the "Illumina Genome Analyzer Software // License Agreement" and the "Illumina Source Code License Agreement", // and certain third party copyright/licenses, and any user of this // source file is bound by the terms therein (see accompanying files // Illumina_Genome_Analyzer_Software_License_Agreement.pdf and // Illumina_Source_Code_License_Agreement.pdf and third party // copyright/license notices). // // /// \file /// \author Ivan Mikoulitch /// #ifndef __STRINGSPLITTER_H #define __STRINGSPLITTER_H #include "SamMD2Export/stdafx.h" #include "SamMD2Export/utils.h" class StringSplitterJet { public: StringSplitterJet(char*, char separator='\t'); inline string GetString(int start_index) { int start = indexes_[start_index-1]+1; string str(&buffer_[start]); return str; } inline char* GetPChar(int start_index) { int start = indexes_[start_index-1]+1; return &buffer_[start]; } inline void MakeUpperCase(int start_index) { int start = indexes_[start_index-1]+1; ToUpper(&buffer_[start]); } inline int GetNumElements() { return num_elements; } string GetOriginalString(); private: char separator_; char* buffer_; int indexes_[32]; int num_elements; void ProcessString(); }; #endif