/* ==================================================================== * Copyright (c) 2003-2006, Martin Hauner * http://subcommander.tigris.org * * Subcommander is licensed as described in the file doc/COPYING, which * you should have received as part of this distribution. * ==================================================================== */ #ifndef _SC_TAB_H #define _SC_TAB_H /** * \brief helper class for handling tabs in text lines. */ // TODO rename.. class Tab { public: Tab( unsigned int tabwidth ); unsigned int calcColumns( const char* s ); int calcColumnForNextChar( const char* s, int pos ); int calcColumnForPrevChar( const char* s, int pos ); int calcCharOffsetForColumn( const char* s, int col ); int calcColumnForColumn( const char* s, int col ); private: unsigned int _tabwidth; ///< tabwidth to use for calculations }; #endif // _SC_TAB_H