// // 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 /// #include "stringSplitter.h" ////////////////////////////////////////////////////////////////////// StringSplitterJet::StringSplitterJet(char* buffer, char separator /*='\t'*/) : separator_(separator), buffer_(buffer) { ProcessString(); } ////////////////////////////////////////////////////////////////////// void StringSplitterJet::ProcessString() { indexes_[0]=-1; int index=0; num_elements=0; char* pch = buffer_; while(*pch!='\0') { if (*pch==separator_) { *pch='\0'; indexes_[++num_elements]=index; } ++pch; ++index; } indexes_[++num_elements]=index; return; } ////////////////////////////////////////////////////////////////////// string StringSplitterJet::GetOriginalString() { for(int i=1; i