/* Date.h Project: NamespaceDate Demonstrate how to create and use a namespace Based on the Date class used to demonstrate separate compilation. Most comments are removed so that we can focus on the namespace issues. */ #ifndef DATE_H #define DATE_H #include #include // Here we create the namespace ASillyName // If this namespace already existed, then we would just // be adding to it. Either is fine. namespace ASillyName { class Date { public: Date(const std::string& date); void setYear(int y); int getYear() const; void display(std::ostream& = std::cout) const; bool earlierThan(const Date&) const; int daysBetween(const Date&) const; // We haven't implemented this yet void addDays(int days); // We haven't implemented this yet private: int day, month, year; }; } #endif // #ifndef DATE_H