"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "user_filter.h" between
ocrad-0.25-pre5.tar.gz and ocrad-0.25-pre6.tar.gz

About: GNU Ocrad is an OCR (Optical Character Recognition) program. Pre-release.

user_filter.h  (ocrad-0.25-pre5):user_filter.h  (ocrad-0.25-pre6)
skipping to change at line 20 skipping to change at line 20
but WITHOUT ANY WARRANTY; without even the implied warranty of but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details. GNU General Public License for more details.
You should have received a copy of the GNU General Public License You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>. along with this program. If not, see <http://www.gnu.org/licenses/>.
*/ */
class User_filter class User_filter
{ {
public:
// default action: discard, leave unmodified, mark as unrecognized
enum Default { d_discard = 0, d_leave, d_mark };
private:
struct Entry struct Entry
{ {
int code; int code;
int new_code; int new_code;
Entry( const int c, const int nc ) : code( c ), new_code( nc ) {} Entry( const int c, const int nc ) : code( c ), new_code( nc ) {}
}; };
std::vector< int > table1; // -1 or new_code of first 256 UCS chars std::vector< int > table1; // -1 or new_code of first 256 UCS chars
std::vector< Entry > table2; // codes of UCS chars >= 256 std::vector< Entry > table2; // codes of UCS chars >= 256
std::string error_; std::string error_;
int retval_; int retval_;
Default default_;
bool enable_char( const int code, int new_code ); bool enable_char( const int code, int new_code );
int parse_char( const std::string & line, unsigned &i ) const; int parse_char( const std::string & line, unsigned &i ) const;
void set_file_error( const char * const file_name, const int linenum ); void set_file_error( const char * const file_name, const int linenum );
public: public:
explicit User_filter( const char * const file_name ); explicit User_filter( const char * const file_name );
const std::string & error() const { return error_; } const std::string & error() const { return error_; }
int retval() const { return retval_; } int retval() const { return retval_; }
int get_new_code( const int code ) const; // -1 means disabled int get_new_code( const int code ) const; // -1 means disabled
bool discard() const { return default_ == d_discard; }
bool mark() const { return default_ == d_mark; }
}; };
 End of changes. 3 change blocks. 
0 lines changed or deleted 8 lines changed or added

Home  |  About  |  All  |  Newest  |  Fossies Dox  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTPS