X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;f=source%2Flibr2c2%2Farticlenumber.h;h=79356c88b7008be05e8fa8cdeb76267a531a4289;hb=b860a56bd9bc8894311c02d7673f379beff3220b;hp=cf69c42dbbf0facacee57ee810b357d76f72fc6f;hpb=1ff06c5bc46a677fa389ef86c6b26664368f1653;p=r2c2.git diff --git a/source/libr2c2/articlenumber.h b/source/libr2c2/articlenumber.h index cf69c42..79356c8 100644 --- a/source/libr2c2/articlenumber.h +++ b/source/libr2c2/articlenumber.h @@ -1,43 +1,38 @@ -/* $Id$ - -This file is part of R²C² -Copyright © 2010 Mikkosoft Productions, Mikko Rasa -Distributed under the GPL -*/ - #ifndef LIBR2C2_ARTICLENUMBER_H_ #define LIBR2C2_ARTICLENUMBER_H_ #include #include +#include #include namespace R2C2 { class ArticleNumber { -private: - struct Part +public: + class Loader: public Msp::DataFile::ObjectLoader { - unsigned number; - char letter; - - bool operator<(const Part &) const; + public: + Loader(ArticleNumber &); }; - std::vector parts; +private: + std::string vendor; + std::string article; + std::string part; public: ArticleNumber() { } - ArticleNumber(unsigned); ArticleNumber(const std::string &); + ArticleNumber(const std::string &, const std::string &, const std::string & = std::string()); + const std::string &get_vendor() const { return vendor; } + const std::string &get_article() const { return article; } + const std::string &get_part() const { return part; } std::string str() const; - - bool operator<(const ArticleNumber &) const; }; -void operator>>(const Msp::LexicalConverter &, ArticleNumber &); void operator<<(Msp::LexicalConverter &, const ArticleNumber &); } // namespace R2C2