From 6d04ac9ad89293ecc08013d6df97b880ec1e3a69 Mon Sep 17 00:00:00 2001 From: Dave Reisner Date: Thu, 3 Jan 2013 10:58:32 -0500 Subject: allow card lookup by index --- pulse.cc | 3 +++ 1 file changed, 3 insertions(+) (limited to 'pulse.cc') diff --git a/pulse.cc b/pulse.cc index edd0449..c423c72 100644 --- a/pulse.cc +++ b/pulse.cc @@ -150,6 +150,9 @@ Card* PulseClient::GetCard(const uint32_t& index) { } Card* PulseClient::GetCard(const string& name) { + long val; + if (xstrtol(name.c_str(), &val) == 0) return GetCard(val); + for (Card& card : cards_) { if (card.name_ == name) return &card; } -- cgit v1.2.3