This commit is contained in:
Joakim Hove 2013-10-16 09:59:32 +02:00
parent 2d68ebe94c
commit 0aa416675a
3 changed files with 12 additions and 2 deletions

View File

@ -64,13 +64,14 @@ namespace Opm {
DeckItemConstPtr ParserIntItem::scan(RawRecordPtr rawRecord) const {
DeckIntItemPtr deckItem(new DeckIntItem(name()));
int defaultValue = m_default;
if (sizeType() == ALL) { // This can probably not be combined with a default value ....
// The '*' should be interpreted as a multiplication sign
while (rawRecord->size() > 0) {
std::string token = rawRecord->pop_front();
if (tokenContainsStar( token )) {
StarToken<int> st(token);
int value = defaultValue;
int value = defaultValue; // This probably does never apply
if (st.hasValue())
value = st.value();
deckItem->push_backMultiple( value , st.multiplier() );

View File

@ -37,7 +37,7 @@ namespace Opm {
ParserIntItem(const std::string& itemName, ParserItemSizeEnum sizeType);
ParserIntItem(const std::string& itemName, int defaultValue);
ParserIntItem(const std::string& itemName, ParserItemSizeEnum sizeType, int defaultValue);
ParserIntItem( const Json::JsonObject& jsonConfig);
ParserIntItem(const Json::JsonObject& jsonConfig);
DeckItemConstPtr scan(RawRecordPtr rawRecord) const;
bool equal(const ParserIntItem& other) const;
@ -54,6 +54,13 @@ namespace Opm {
typedef boost::shared_ptr<const ParserIntItem> ParserIntItemConstPtr;
typedef boost::shared_ptr<ParserIntItem> ParserIntItemPtr;
template<class T>
class ParserXItem : public ParserItem{
public:
ParserXItem(const std::string& itemName) { };
};
}
#endif /* PARSERINTITEM_HPP */

View File

@ -67,6 +67,8 @@ namespace Opm {
typedef boost::shared_ptr<const ParserItem> ParserItemConstPtr;
typedef boost::shared_ptr<ParserItem> ParserItemPtr;
}
#endif