]> git.tdb.fi Git - r2c2.git/blob - source/libr2c2/articlenumber.h
Rework article numbers
[r2c2.git] / source / libr2c2 / articlenumber.h
1 #ifndef LIBR2C2_ARTICLENUMBER_H_
2 #define LIBR2C2_ARTICLENUMBER_H_
3
4 #include <string>
5 #include <vector>
6 #include <msp/datafile/objectloader.h>
7 #include <msp/strings/lexicalcast.h>
8
9 namespace R2C2 {
10
11 class ArticleNumber
12 {
13 public:
14         class Loader: public Msp::DataFile::ObjectLoader<ArticleNumber>
15         {
16         public:
17                 Loader(ArticleNumber &);
18         };
19
20 private:
21         std::string vendor;
22         std::string article;
23         std::string part;
24
25 public:
26         ArticleNumber() { }
27         ArticleNumber(const std::string &);
28         ArticleNumber(const std::string &, const std::string &, const std::string & = std::string());
29
30         const std::string &get_vendor() const { return vendor; }
31         const std::string &get_article() const { return article; }
32         const std::string &get_part() const { return part; }
33         std::string str() const;
34 };
35
36 void operator<<(Msp::LexicalConverter &, const ArticleNumber &);
37
38 } // namespace R2C2
39
40 #endif