fp@1826: /***************************************************************************** fp@1826: * fp@1826: * $Id$ fp@1826: * fp@1826: * Copyright (C) 2006-2009 Florian Pose, Ingenieurgemeinschaft IgH fp@1826: * fp@1826: * This file is part of the IgH EtherCAT Master. fp@1826: * fp@1826: * The IgH EtherCAT Master is free software; you can redistribute it and/or fp@1826: * modify it under the terms of the GNU General Public License version 2, as fp@1826: * published by the Free Software Foundation. fp@1826: * fp@1826: * The IgH EtherCAT Master is distributed in the hope that it will be useful, fp@1826: * but WITHOUT ANY WARRANTY; without even the implied warranty of fp@1826: * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General fp@1826: * Public License for more details. fp@1826: * fp@1826: * You should have received a copy of the GNU General Public License along fp@1826: * with the IgH EtherCAT Master; if not, write to the Free Software fp@1826: * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA fp@1826: * fp@1826: * --- fp@1826: * fp@1826: * The license mentioned above concerns the source code only. Using the fp@1826: * EtherCAT technology and brand is only permitted in compliance with the fp@1826: * industrial property and similar rights of Beckhoff Automation GmbH. fp@1826: * fp@1826: ****************************************************************************/ fp@1826: fp@1826: #include fp@1826: using namespace std; fp@1826: fp@1826: /*****************************************************************************/ fp@1826: fp@1826: class NumberListParser fp@1826: { fp@1826: public: fp@1826: NumberListParser(); fp@1829: virtual ~NumberListParser(); fp@1826: fp@2010: typedef list List; fp@1826: fp@2010: List parse(const char *); fp@1826: fp@2010: virtual int getMax() = 0; fp@1826: fp@1826: private: fp@2010: int max; fp@1826: bool hasMax; fp@1826: fp@2010: int maximum(); fp@1826: fp@1826: static bool isNumeric(char); fp@1826: static unsigned int parseNumber(const char *, unsigned int *, fp@1826: unsigned int); fp@2010: static List range(unsigned int, unsigned int); fp@1826: }; fp@1826: fp@1826: /****************************************************************************/