| 1 | /*************************************************************************** |
| 2 | misc.h |
| 3 | ------------------- |
| 4 | A generic ingredient class |
| 5 | ------------------- |
| 6 | Copyright 1999-2008, David Johnson |
| 7 | All rights reserved. |
| 8 | |
| 9 | Redistribution and use in source and binary forms, with or without |
| 10 | modification, are permitted provided that the following conditions are met: |
| 11 | |
| 12 | 1. Redistributions of source code must retain the above copyright notice, |
| 13 | this list of conditions and the following disclaimer. |
| 14 | |
| 15 | 2. Redistributions in binary form must reproduce the above copyright notice, |
| 16 | this list of conditions and the following disclaimer in the documentation |
| 17 | and/or other materials provided with the distribution. |
| 18 | |
| 19 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS'' |
| 20 | AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE |
| 21 | IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE |
| 22 | ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDERS OR CONTRIBUTORS BE |
| 23 | LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR |
| 24 | CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF |
| 25 | SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS |
| 26 | INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN |
| 27 | CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) |
| 28 | ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE |
| 29 | POSSIBILITY OF SUCH DAMAGE. |
| 30 | ***************************************************************************/ |
| 31 | |
| 32 | #ifndef MISC_H |
| 33 | #define MISC_Hcxx . . $ `src/misc.h:33:9`! |
| 34 | |
| 35 | #include <QList> |
| 36 | #include <QMap> |
| 37 | #include <QString> |
| 38 | |
| 39 | #include "quantity.h"cxx . . $ `<file>/src/quantity.h`/ |
| 40 | |
| 41 | class Misccxx . . $ Misc# { |
| 42 | public: |
| 43 | // misc strings |
| 44 | static const QByteArraycxx . . $ QByteArray# YEAST_STRINGcxx . . $ Misc#YEAST_STRING.; |
| 45 | static const QByteArraycxx . . $ QByteArray# FINING_STRINGcxx . . $ Misc#FINING_STRING.; |
| 46 | static const QByteArraycxx . . $ QByteArray# HERB_STRINGcxx . . $ Misc#HERB_STRING.; |
| 47 | static const QByteArraycxx . . $ QByteArray# SPICE_STRINGcxx . . $ Misc#SPICE_STRING.; |
| 48 | static const QByteArraycxx . . $ QByteArray# FLAVOR_STRINGcxx . . $ Misc#FLAVOR_STRING.; |
| 49 | static const QByteArraycxx . . $ QByteArray# ADDITIVE_STRINGcxx . . $ Misc#ADDITIVE_STRING.; |
| 50 | static const QByteArraycxx . . $ QByteArray# OTHER_STRINGcxx . . $ Misc#OTHER_STRING.; |
| 51 | |
| 52 | // default constructor |
| 53 | Misccxx . . $ Misc#Misc(49f6e7a06ebc5aa8).(); |
| 54 | // full constructor |
| 55 | Misccxx . . $ Misc#Misc(7415d5dc4237b0d8).(const QStringcxx . . $ QString# &name, const Quantitycxx . . $ Quantity# &quantity, |
| 56 | const QStringcxx . . $ QString# &typ, const QStringcxx . . $ QString# ¬es); |
| 57 | // copy constructor |
| 58 | Misccxx . . $ Misc#Misc(9f5928fef634771).(const Misccxx . . $ Misc# &m); |
| 59 | // assignment operator |
| 60 | Misccxx . . $ Misc# operatorcxx . . $ Misc#`operator=`(3dcb871d488786fb).=(const Misccxx . . $ Misc# &m); |
| 61 | // comparison operator |
| 62 | bool operatorcxx . . $ Misc#`operator==`(24b2ce2e9bd87498).==(const Misccxx . . $ Misc# &m) const; |
| 63 | bool operatorcxx . . $ Misc#`operator<`(24b2ce2e9bd87498).<(const Misccxx . . $ Misc# &m) const; |
| 64 | // destructor |
| 65 | ~cxx . . $ Misc#`~Misc`(ced63f7c635d850d).Misccxx . . $ Misc#(); |
| 66 | |
| 67 | //get/set name |
| 68 | const QStringcxx . . $ QString# &namecxx . . $ Misc#name(a2fb7a6ce195d51).() const; |
| 69 | void setNamecxx . . $ Misc#setName(3520e46b33348bf6).(const QStringcxx . . $ QString# &name); |
| 70 | // get/set quantity |
| 71 | const Quantitycxx . . $ Quantity# &quantitycxx . . $ Misc#quantity(48cf8e1c6c284286).() const; |
| 72 | void setQuantitycxx . . $ Misc#setQuantity(41e9971a986bf65f).(const Quantitycxx . . $ Quantity# &quantity); |
| 73 | // get/set type |
| 74 | const QStringcxx . . $ QString# &typecxx . . $ Misc#type(a2fb7a6ce195d51).() const; |
| 75 | void setTypecxx . . $ Misc#setType(3520e46b33348bf6).(const QStringcxx . . $ QString# &typ); |
| 76 | // get/set notes |
| 77 | const QStringcxx . . $ QString# ¬escxx . . $ Misc#notes(a2fb7a6ce195d51).() const; |
| 78 | void setNotescxx . . $ Misc#setNotes(3520e46b33348bf6).(const QStringcxx . . $ QString# ¬es); |
| 79 | |
| 80 | // list of misc type |
| 81 | static QStringListcxx . . $ QStringList# typeStringListcxx . . $ Misc#typeStringList(669a05bc42dd57cc).(); |
| 82 | |
| 83 | private: |
| 84 | QStringcxx . . $ QString# name_cxx . . $ Misc#name_.; |
| 85 | Quantitycxx . . $ Quantity# quantity_cxx . . $ Misc#quantity_.; |
| 86 | QStringcxx . . $ QString# type_cxx . . $ Misc#type_.; |
| 87 | QStringcxx . . $ QString# notes_cxx . . $ Misc#notes_.; |
| 88 | }; |
| 89 | |
| 90 | typedef QListcxx . . $ QList#<Misccxx . . $ Misc#> MiscListcxx . . $ MiscList#; |
| 91 | typedef QMapcxx . . $ QMap#<QStringcxx . . $ QString#,Misccxx . . $ Misc#> MiscMapcxx . . $ MiscMap#; |
| 92 | |
| 93 | ////////////////////////////////////////////////////////////////////////////// |
| 94 | // Inlined Methods |
| 95 | |
| 96 | inline bool Misccxx . . $ Misc#::operatorcxx . . $ Misc#`operator<`(24b2ce2e9bd87498).<(const Misccxx . . $ Misc# &m) const { return (name_cxx . . $ Misc#name_. <cxx . . $ `operator<`(5bc2975d2d751687). m.name_cxx . . $ Misc#name_.); } |
| 97 | |
| 98 | inline void Misccxx . . $ Misc#::setNamecxx . . $ Misc#setName(3520e46b33348bf6).(const QStringcxx . . $ QString# &name) { name_cxx . . $ Misc#name_. =cxx . . $ QString#`operator=`(b79fde0b0ce9b948). name; } |
| 99 | |
| 100 | inline const QStringcxx . . $ QString# &Misccxx . . $ Misc#::namecxx . . $ Misc#name(a2fb7a6ce195d51).() const { return name_cxx . . $ Misc#name_.; } |
| 101 | |
| 102 | inline void Misccxx . . $ Misc#::setQuantitycxx . . $ Misc#setQuantity(41e9971a986bf65f).(const Quantitycxx . . $ Quantity# &quantity) { quantity_cxx . . $ Misc#quantity_. =cxx . . $ Quantity#`operator=`(3ef0f3c5d324c832). quantity; } |
| 103 | |
| 104 | inline const Quantitycxx . . $ Quantity# &Misccxx . . $ Misc#::quantitycxx . . $ Misc#quantity(48cf8e1c6c284286).() const { return quantity_cxx . . $ Misc#quantity_.; } |
| 105 | |
| 106 | inline void Misccxx . . $ Misc#::setTypecxx . . $ Misc#setType(3520e46b33348bf6).(const QStringcxx . . $ QString# &typ) { type_cxx . . $ Misc#type_. =cxx . . $ QString#`operator=`(b79fde0b0ce9b948). typ; } |
| 107 | |
| 108 | inline const QStringcxx . . $ QString# &Misccxx . . $ Misc#::typecxx . . $ Misc#type(a2fb7a6ce195d51).() const { return type_cxx . . $ Misc#type_.; } |
| 109 | |
| 110 | inline void Misccxx . . $ Misc#::setNotescxx . . $ Misc#setNotes(3520e46b33348bf6).(const QStringcxx . . $ QString# ¬es) { notes_cxx . . $ Misc#notes_. =cxx . . $ QString#`operator=`(b79fde0b0ce9b948). notes; } |
| 111 | |
| 112 | inline const QStringcxx . . $ QString# &Misccxx . . $ Misc#::notescxx . . $ Misc#notes(a2fb7a6ce195d51).() const{ return notes_cxx . . $ Misc#notes_.; } |
| 113 | |
| 114 | #endif // MISC_H |