cosmetic + updated copyright year
This commit is contained in:
parent
6e15a32973
commit
4a7d0b8434
4 changed files with 12 additions and 20 deletions
|
@ -24,8 +24,8 @@
|
||||||
|
|
||||||
#include "ClientPattern.hh"
|
#include "ClientPattern.hh"
|
||||||
#include "RegExp.hh"
|
#include "RegExp.hh"
|
||||||
#include "StringUtil.hh"
|
|
||||||
#include "WinClient.hh"
|
#include "WinClient.hh"
|
||||||
|
#include "FbTk/StringUtil.hh"
|
||||||
#include "FbTk/App.hh"
|
#include "FbTk/App.hh"
|
||||||
|
|
||||||
// use GNU extensions
|
// use GNU extensions
|
||||||
|
|
|
@ -23,22 +23,14 @@
|
||||||
// $Id$
|
// $Id$
|
||||||
|
|
||||||
#include "CommandParser.hh"
|
#include "CommandParser.hh"
|
||||||
|
#include "FbTk/StringUtil.hh"
|
||||||
#include "StringUtil.hh"
|
|
||||||
|
|
||||||
#include <vector>
|
#include <vector>
|
||||||
using namespace std;
|
|
||||||
|
|
||||||
namespace {
|
using std::string;
|
||||||
|
using std::vector;
|
||||||
string::size_type removeFirstWhitespace(std::string &str) {
|
using FbTk::StringUtil::removeFirstWhitespace;
|
||||||
string::size_type first_pos = str.find_first_not_of(" \t");
|
using FbTk::StringUtil::toLower;
|
||||||
if (first_pos != string::npos)
|
|
||||||
str.erase(0, first_pos);
|
|
||||||
return first_pos;
|
|
||||||
}
|
|
||||||
|
|
||||||
}; // end anonymous namespace
|
|
||||||
|
|
||||||
CommandFactory::CommandFactory() {
|
CommandFactory::CommandFactory() {
|
||||||
|
|
||||||
|
@ -49,7 +41,7 @@ CommandFactory::~CommandFactory() {
|
||||||
CommandParser::instance().removeAssociation(*this);
|
CommandParser::instance().removeAssociation(*this);
|
||||||
}
|
}
|
||||||
|
|
||||||
void CommandFactory::addCommand(const std::string &command_name) {
|
void CommandFactory::addCommand(const string &command_name) {
|
||||||
CommandParser::instance().associateCommand(command_name, *this);
|
CommandParser::instance().associateCommand(command_name, *this);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -58,7 +50,7 @@ CommandParser &CommandParser::instance() {
|
||||||
return singleton;
|
return singleton;
|
||||||
}
|
}
|
||||||
|
|
||||||
FbTk::Command *CommandParser::parseLine(const std::string &line) {
|
FbTk::Command *CommandParser::parseLine(const string &line) {
|
||||||
|
|
||||||
// parse arguments and command
|
// parse arguments and command
|
||||||
string command = line;
|
string command = line;
|
||||||
|
@ -74,7 +66,7 @@ FbTk::Command *CommandParser::parseLine(const std::string &line) {
|
||||||
|
|
||||||
// now we have parsed command and arguments
|
// now we have parsed command and arguments
|
||||||
|
|
||||||
command = FbTk::StringUtil::toLower(command);
|
command = toLower(command);
|
||||||
|
|
||||||
// we didn't find any matching command in default commands,
|
// we didn't find any matching command in default commands,
|
||||||
// so we search in the command creators modules for a
|
// so we search in the command creators modules for a
|
||||||
|
@ -100,7 +92,7 @@ void CommandParser::associateCommand(const std::string &command, CommandFactory
|
||||||
|
|
||||||
void CommandParser::removeAssociation(CommandFactory &factory) {
|
void CommandParser::removeAssociation(CommandFactory &factory) {
|
||||||
// commands that are associated with the factory
|
// commands that are associated with the factory
|
||||||
std::vector<std::string> commands;
|
vector<string> commands;
|
||||||
// find associations
|
// find associations
|
||||||
CommandFactoryMap::iterator factory_it = m_commandfactorys.begin();
|
CommandFactoryMap::iterator factory_it = m_commandfactorys.begin();
|
||||||
const CommandFactoryMap::iterator factory_it_end = m_commandfactorys.end();
|
const CommandFactoryMap::iterator factory_it_end = m_commandfactorys.end();
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
// StringUtil.hh for fluxbox
|
// StringUtil.hh for fluxbox
|
||||||
// Copyright (c) 2001 - 2004 Henrik Kinnunen (fluxgen at fluxbox dot org)
|
// Copyright (c) 2001 - 2005 Henrik Kinnunen (fluxgen at fluxbox dot org)
|
||||||
//
|
//
|
||||||
// Permission is hereby granted, free of charge, to any person obtaining a
|
// Permission is hereby granted, free of charge, to any person obtaining a
|
||||||
// copy of this software and associated documentation files (the "Software"),
|
// copy of this software and associated documentation files (the "Software"),
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
// Keys.cc for Fluxbox - an X11 Window manager
|
// Keys.cc for Fluxbox - an X11 Window manager
|
||||||
// Copyright (c) 2001 - 2003 Henrik Kinnunen (fluxgen at fluxbox dot org)
|
// Copyright (c) 2001 - 2005 Henrik Kinnunen (fluxgen at fluxbox dot org)
|
||||||
//
|
//
|
||||||
// Permission is hereby granted, free of charge, to any person obtaining a
|
// Permission is hereby granted, free of charge, to any person obtaining a
|
||||||
// copy of this software and associated documentation files (the "Software"),
|
// copy of this software and associated documentation files (the "Software"),
|
||||||
|
|
Loading…
Reference in a new issue