-/* $Id$
-
-This file is part of R²C²
-Copyright © 2010-2011 Mikkosoft Productions, Mikko Rasa
-Distributed under the GPL
-*/
-
-#include <msp/strings/formatter.h>
+#include <msp/strings/format.h>
#include <msp/time/units.h>
#include "block.h"
#include "catalogue.h"
void Timetable::insert(unsigned i, const Row &row)
{
if(i>rows.size())
- throw InvalidParameterValue("Insert position out of range");
+ throw out_of_range("Timetable::insert");
rows.insert(rows.begin()+i, row);
if(i<=current_row)
const Timetable::Row &Timetable::get_row(unsigned i) const
{
if(i>=rows.size())
- throw InvalidParameterValue("Row index out of range");
+ throw out_of_range("Timetable::get_row");
return rows[i];
}
{
string::size_type space = name.rfind(' ');
if(space==string::npos || space==0)
- throw InvalidParameterValue("Invalid zone name");
+ throw invalid_argument("Timetable::get_zone");
unsigned number = lexical_cast<unsigned>(name.substr(space+1));
return train.get_layout().get_zone(name.substr(0, space), number);
}
const T &Timetable::Row::get_param(unsigned i) const
{
if(i>=params.size())
- throw InvalidParameterValue("Parameter index out of range");
+ throw out_of_range("Timetable::Row::get_param");
return params[i].value<T>();
}
return Row(ROUTE, s.substr(10));
}
- throw InvalidParameterValue("Invalid row");
+ throw invalid_argument("Timetable::Row::parse");
}