Code Cleanup

- Removed obsolete A3::rc_overrides and A3::get_data_location methods.
This commit is contained in:
Paul Beckingham 2014-04-14 00:07:40 -04:00
parent ebd522dfee
commit a91101919d
2 changed files with 0 additions and 56 deletions

View file

@ -313,60 +313,6 @@ void A3::append_stdin ()
#endif
}
////////////////////////////////////////////////////////////////////////////////
void A3::rc_override (
std::string& home,
File& rc)
{
// Is there an override for rc:<file>?
std::vector <Arg>::iterator arg;
for (arg = this->begin (); arg != this->end (); ++arg)
{
if (arg->_category == Arg::cat_rc)
{
rc = File (arg->_raw.substr (3));
home = rc;
std::string::size_type last_slash = rc._data.rfind ("/");
if (last_slash != std::string::npos)
home = rc._data.substr (0, last_slash);
else
home = ".";
context.header (format (STRING_A3_ALTERNATE_RC, rc._data));
// Keep looping, because if there are multiple rc:file arguments, we
// want the last one to dominate.
}
}
}
////////////////////////////////////////////////////////////////////////////////
void A3::get_data_location (std::string& data)
{
std::string location = context.config.get ("data.location");
if (location != "")
data = location;
// Are there any overrides for data.location?
std::vector <Arg>::iterator arg;
for (arg = this->begin (); arg != this->end (); ++arg)
{
if (arg->_category == Arg::cat_override)
{
if (arg->_raw.substr (0, 16) == "rc.data.location" &&
(arg->_raw[16] == ':' || arg->_raw[16] == '='))
{
data = arg->_raw.substr (17);
context.header (format (STRING_A3_ALTERNATE_DATA, data));
}
}
// Keep looping, because if there are multiple overrides, we want the last
// one to dominate.
}
}
////////////////////////////////////////////////////////////////////////////////
// An alias must be a distinct word on the command line.
// Aliases may not recurse.

View file

@ -51,8 +51,6 @@ public:
static const std::vector <std::string> operator_list ();
void append_stdin ();
void rc_override (std::string&, File&);
void get_data_location (std::string&);
void resolve_aliases ();
void apply_overrides ();
void inject_defaults ();