Changeset ebc866


Ignore:
Timestamp:
Sep 6, 2015, 10:25:00 PM (10 years ago)
Author:
Frederik Heber <heber@…>
Children:
b303d0
Parents:
5c22be
git-author:
Frederik Heber <heber@…> (03/13/15 15:01:16)
git-committer:
Frederik Heber <heber@…> (09/06/15 22:25:00)
Message:

Added DeleteCommand(string) to CommandList.

  • iterator is actually not available outside CommandList class.
Location:
src/base
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • src/base/command_list.cpp

    r5c22be rebc866  
    106106}
    107107
     108void CommandList::DeleteCommand(const std::string& _command)
     109{
     110  CommandList::iterator iter = commands.begin();
     111  for (;iter != commands.end(); ++iter)
     112          if (iter->first == _command)
     113                  break;
     114  assert( iter != commands.end() );
     115  DeleteCommand(iter);
     116}
     117
    108118void CommandList::Print()
    109119{
  • src/base/command_list.hpp

    r5c22be rebc866  
    5050
    5151  void AddCommand(std::string command, std::string arguments = ""); ///< Add a command to the back of the list.
    52   void DeleteCommand(const CommandList::iterator& iter);          ///< Remove a command from the list.
     52  void DeleteCommand(const std::string& command);          ///< Remove a command from the list.
    5353
    5454  void Print(); ///< Print all commands in list.
    5555
    5656  void Clear(); ///< Remove all commands from list.
     57
     58protected:
     59  void DeleteCommand(const CommandList::iterator& iter);          ///< Remove a command from the list.
    5760
    5861private:
Note: See TracChangeset for help on using the changeset viewer.