|
// mytime.h
// defines a time type
// Date: 22/11/03
// Author: Vijay Mathew Pandyalakal
/* Copyright 2000 - 2005 Vijay Mathew Pandyalakal. All rights reserved.
*
* This software may be used or modified for any purpose, personal or
* commercial. Open Source redistributions are permitted.
*
* Redistributions qualify as "Open Source" under one of the following terms:
*
* Redistributions are made at no charge beyond the reasonable cost of
* materials and delivery.
*
* Redistributions are accompanied by a copy of the Source Code or by an
* irrevocable offer to provide a copy of the Source Code for up to three
* years at the cost of materials and delivery. Such redistributions
* must allow further use, modification, and redistribution of the Source
* Code under substantially the same terms as this license.
*
* Redistributions of source code must retain the copyright notices as they
* appear in each source code file, these license terms, and the
* disclaimer/limitation of liability set forth as paragraph 6 below.
*
* Redistributions in binary form must reproduce this Copyright Notice,
* these license terms, and the disclaimer/limitation of liability set
* forth as paragraph 6 below, in the documentation and/or other materials
* provided with the distribution.
*
* The Software is provided on an "AS IS" basis. No warranty is
* provided that the Software is free of defects, or fit for a
* particular purpose.
*
* Limitation of Liability. The Author shall not be liable
* for any damages suffered by the Licensee or any third party resulting
* from use of the Software.
*/
#ifndef MYTIME_H_
#define MYTIME_H_
namespace openutils {
class MyTime {
private:
int hr;
int min;
int sec;
public:
MyTime();
MyTime(const char* time);
void setTime(const char* time);
string getTime(bool _24hourformat = true);
bool operator == (MyTime time);
bool operator != (MyTime time);
bool operator > (MyTime time);
bool operator < (MyTime time);
private:
void validate();
};
class MyTimeException {
string str;
public:
MyTimeException(const char* err);
string getMessage();
};
}
#endif
|
By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.
If a file you wish to view isn't highlighted, and is a text file (not binary), please
let us know and we'll add colourisation support for it.
This member has not yet provided a Biography. Assume it's interesting and varied, and probably something to do with programming.