Blame view

src/TimeTableCatalog/ParameterDescription.cc 502 Bytes
fbe3c2bb   Benjamin Renard   First commit
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
/*
 * ParameterDescription.cc
 *
 *  Created on: Nov 10, 2014
 *      Author: m.mazel
 */
#include "ParameterDescription.hh"
#include "TimeTableCatalogUtil.hh"

namespace TimeTableCatalog {

int ParameterDescription::getSizeAsInt() {
	if (_size.find("x") == std::string::npos) {
		return atoi(_size.c_str());
	}
	else {
		std::vector<std::string> operandes;
		split (_size, 'x', operandes);
		return (atoi (operandes[0].c_str()) * atoi (operandes[1].c_str()));
	}
}

} /* namespace TimeTableCatalog */