gnStringTools.h Source File

Main Page Namespace List Class Hierarchy Alphabetical List Compound List File List Compound Members File Members

# gnStringTools.h

Go to the documentation of this file.

    00001
    00002 // File:            gnStringTools.h
    00003 // Purpose:         Random string manipulation tools
    00004 // Description:     Random string manipulation tools
    00005 // Changes:
    00006 // Version:         libGenome 0.1.0
    00007 // Author:          Aaron Darling
    00008 // Last Edited:     April 15, 2001, 10:34:50pm
    00009 // Modified by:
    00010 // Copyright:       (c) Aaron Darling
    00011 // Licenses:        Proprietary
    00013
    00014 #ifndef _gnStringTools_h_
    00015 #define _gnStringTools_h_
    00016
    00017 #include <iostream>
    00018 #include <string>
    00019 #include <vector>
    00020 #include <stdlib.h>
    00021 #include <stdio.h>
    00022 #include "gn/gnDefs.h"
    00023
    00024 unsigned int removeSpace(string &str);
    00025 void removeEndSpace(string &str);
    00026
    00027 bool isNewLine(char ch);
    00028 bool isWhiteSpace(char ch);
    00029 bool isSpace(char ch);
    00030
    00031 string uintToString(unsigned int value);
    00032
    00033 string ulongToString(unsigned long value);
    00034
    00035 string charArrayToString( char *charArray, unsigned int length);
    00036
    00037 bool isBase(char base);
    00038 void BaseCount(const string& bases, gnSeqI& a_count, gnSeqI& c_count, gnSeqI& g_count, gnSeqI& t_count, gnSeqI& other_count);
    00039
    00040 unsigned int parseValue(string &valueString);
    00041 int parseUintValue(string &valueString);
    00042 int parseIntValue(string &valueString);
    00043
    00044 vector< string > tokenizeString( const string &str, char delimiter  = '\t' );
    00045 vector< string > tokenizeString( const char* str, unsigned int len, char delimiter = '\t' );
    00046
    00047 // **** MAKE SURE YOU STANDARIZE ALL PATHS ****
    00048 void standarizePathString( string &oFileName );
    00049
    00050 // **** ONLY '/' IS USED for file seperation on all below functions ****
    00051
    00052 // make more robust to handle dir and files
    00053 string getPathString( string oFileName );
    00054 // look for '/' at end
    00055 string getFileString( string oFileName );
    00056 // look for '/' before '.'
    00057 string getExtString( string oFileName );
    00058 // look for '/' before '.'
    00059 string getFileNoExtString( string oFileName );
    00060
    00061 #endif
    00062 // gnStringTools_h