]> git.tdb.fi Git - r2c2.git/blob - source/libr2c2/articlenumber.h
c4939674991b69e865017c7c7fc5ab3c09d362b2
[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/strings/lexicalcast.h>
7
8 namespace R2C2 {
9
10 class ArticleNumber
11 {
12 private:
13         struct Part
14         {
15                 unsigned number;
16                 char letter;
17
18                 bool operator<(const Part &) const;
19         };
20
21         std::vector<Part> parts;
22
23 public:
24         ArticleNumber() { }
25         ArticleNumber(unsigned);
26         ArticleNumber(const std::string &);
27
28         std::string str() const;
29
30         bool operator<(const ArticleNumber &) const;
31 };
32
33 void operator>>(const Msp::LexicalConverter &, ArticleNumber &);
34 void operator<<(Msp::LexicalConverter &, const ArticleNumber &);
35
36 } // namespace R2C2
37
38 #endif