diff --git a/cpp/phone-number/phone_number.cpp b/cpp/phone-number/phone_number.cpp new file mode 100644 index 0000000..2e7adac --- /dev/null +++ b/cpp/phone-number/phone_number.cpp @@ -0,0 +1,26 @@ +#include "phone_number.h" + +#include +#include + +using namespace std; + +phone_number::phone_number(const string &str) +{ + static const string invalid_number = "0000000000"; +} + +string phone_number::number() const +{ + return number_; +} + +string phone_number::area_code() const +{ + return area_code_; +} + +phone_number::operator string() const +{ + return number_; +} diff --git a/cpp/phone-number/phone_number.h b/cpp/phone-number/phone_number.h new file mode 100644 index 0000000..f18f51b --- /dev/null +++ b/cpp/phone-number/phone_number.h @@ -0,0 +1,18 @@ +#pragma once + +#include + +class phone_number +{ + std::string area_code_; + std::string number_; + +public: + + phone_number(const std::string&); + + std::string number() const; + std::string area_code() const; + + operator std::string() const; +};