Skip to content

Commit

Permalink
[REFACT] Cleanup: use wrapperId from the superclass
Browse files Browse the repository at this point in the history
  • Loading branch information
hasherezade committed Jul 7, 2024
1 parent 72f6762 commit e11ec8d
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 8 deletions.
1 change: 0 additions & 1 deletion commander/Commander.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,6 @@ bool Commander::addCommand(const std::string& name, Command *cmd, bool overwrite
void Commander::parseCommands()
{
const std::string PROMPT = "$ ";
Command *cmd = NULL;

while (true) {
if (this->context == NULL) throw CmdException("Uninitialized commander context!");
Expand Down
1 change: 1 addition & 0 deletions commander/Commander.h
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ friend class Commander;
class Command
{
public:
Command() {}
Command(const std::string& v_desc) : desc(v_desc) {}
virtual ~Command() {}

Expand Down
8 changes: 3 additions & 5 deletions commander/ExeCommander.h
Original file line number Diff line number Diff line change
Expand Up @@ -123,8 +123,9 @@ class WrapperCommand : public Command
}
wrapperAction(wrapper);
}

protected:
size_t wrapperId; //TODO: fetch it from params!
size_t wrapperId;
};

class AddEntryCommand : public WrapperCommand
Expand Down Expand Up @@ -174,7 +175,7 @@ class DumpWrapperEntriesCommand : public WrapperCommand
{
public:
DumpWrapperEntriesCommand(const std::string& desc, size_t v_wrapperId = INVALID_WRAPPER)
: WrapperCommand(desc), wrapperId(v_wrapperId) {}
: WrapperCommand(desc, v_wrapperId) {}

virtual void wrapperAction(ExeElementWrapper *wrapper)
{
Expand All @@ -196,9 +197,6 @@ class DumpWrapperEntriesCommand : public WrapperCommand
cmd_util::dumpEntryInfo(lib);
cmd_util::dumpNodeInfo(lib);
}

protected:
size_t wrapperId; //TODO: fetch it from params!
};


Expand Down
2 changes: 0 additions & 2 deletions commander/PECommander.h
Original file line number Diff line number Diff line change
Expand Up @@ -101,8 +101,6 @@ class PrintStringsCommand : public Command

cmd_util::printStrings(pe, limit);
}
protected:
int wrapperId; //TODO: fetch it from params!
};

class PrintWrapperTypesCommand : public Command
Expand Down

0 comments on commit e11ec8d

Please sign in to comment.