/* $Id: CCvalidate.h,v 1.2 1998/09/22 16:56:06 thompson Exp thompson $
 * Copyright (c) 1998 MileStone Solutions, Inc.
 *
 * This program is free software; you can redistribute it and/or modify it 
 * under the terms of the GNU General Public License as published by the 
 * Free Software Foundation; either version 2 of the License, or (at your 
 * option) any later version.
 *
 * This program 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 
 * General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License along 
 * with this program; if not, write to the Free Software Foundation, Inc., 
 * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
 *
 * The GNU General Public License can also be found at:
 *
 *     /http://www.fsf.org/copyleft/gpl.html
 *
 *
 * Requires:
 *
 *     gcc/g++ and libg++
 *
 * To build a test program grep out the following line
 * and pass it to a shell.
g++ -o CCvalidate -DTEST CCvalidate.cc #MakeMe
 *
 * Please forward patches to: thompson@inetnow.net
 */
#include <string.h>             // for some char* manipulations
#include <String.h>             // from libg++

class CCvalidate {
  String ccNum;
  String Issuer;
  char _Issuer[32];
  bool valid;
public:
  CCvalidate(char *cc);
  CCvalidate(char *p1, char *p2, char *p3, char *p4);
  bool Valid();
  char *ccIssuer();
  friend ostream& operator<<(ostream& s, CCvalidate &c);
  String CC();
private:
  bool ccValid();
  bool ccPartValid(char *cc1, char *cc2, char *cc3, char *cc4);
  int parseInt(char c);
  void setIssuer(String i);
  void setIssuer(char *i);
};
/* EOF: $Id: CCvalidate.h,v 1.2 1998/09/22 16:56:06 thompson Exp thompson $ */
