00001 // -*- c++ -*- 00002 //------------------------------------------------------------------------------ 00003 // SerialNumber.h 00004 //------------------------------------------------------------------------------ 00005 // $Id: SerialNumber.h,v 1.3 2003/02/07 05:15:10 vlg Exp $ 00006 //------------------------------------------------------------------------------ 00007 // Copyright (c) 2002 by Vladislav Grinchenko 00008 // 00009 // This program is free software; you can redistribute it and/or 00010 // modify it under the terms of the GNU General Public License 00011 // as published by the Free Software Foundation; either version 00012 // 2 of the License, or (at your option) any later version. 00013 //------------------------------------------------------------------------------ 00014 // Created: 07/30/2002 00015 //------------------------------------------------------------------------------ 00016 #ifndef SERIAL_NUMBER_H 00017 #define SERIAL_NUMBER_H 00018 00019 #include <iostream> 00020 #include <string> 00021 using std::string; 00022 00028 class SerialNumber 00029 { 00030 public: 00037 SerialNumber (u_int base_, 00038 const string& prefix_, 00039 const string postfix_, 00040 size_t size_); 00041 00043 operator string (); 00044 00046 SerialNumber operator++ (); 00047 00049 SerialNumber operator++ (int); 00050 00051 private: 00052 string m_prefix; 00053 string m_postfix; 00054 size_t m_size; 00055 size_t m_current; 00056 size_t m_width; 00057 }; 00058 00059 #endif /* SERIAL_NUMBER_H */