From 25ade2f357f1cedf76919f61ae8d81fda7bdf88d Mon Sep 17 00:00:00 2001 From: August Sodora Date: Sun, 20 Nov 2011 17:15:33 -0500 Subject: Refactor BasicCharClass out from scanner and make it a singleton --- basic/source/inc/basiccharclass.hxx | 51 +++++++++++++++++++++++++++++++++++++ 1 file changed, 51 insertions(+) create mode 100644 basic/source/inc/basiccharclass.hxx (limited to 'basic/source/inc') diff --git a/basic/source/inc/basiccharclass.hxx b/basic/source/inc/basiccharclass.hxx new file mode 100644 index 000000000000..0c1e2b4f3e3f --- /dev/null +++ b/basic/source/inc/basiccharclass.hxx @@ -0,0 +1,51 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +#include +#include + +#include + +class BasicCharClass +{ + bool IsLetterTab[256]; + +public: + BasicCharClass(); + + bool isLetter( sal_Unicode c ); + bool isLetterUnicode( sal_Unicode c ); + bool isAlpha( sal_Unicode c, bool bCompatible ); + bool isDigit( sal_Unicode c ); + bool isAlphaNumeric( sal_Unicode c, bool bCompatible ); + bool isWhitespace( sal_Unicode c ); +}; + +class theBasicCharClass: public rtl::Static {}; + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ -- cgit