From 7007dedb45c71f7bd64f1273f4a31978b2e62950 Mon Sep 17 00:00:00 2001 From: Paul Beckingham Date: Tue, 29 Dec 2015 16:24:36 -0500 Subject: [PATCH] Pig: Added ::eos --- src/Pig.cpp | 6 ++++++ src/Pig.h | 2 ++ 2 files changed, 8 insertions(+) diff --git a/src/Pig.cpp b/src/Pig.cpp index c4c41efd..283c1eae 100644 --- a/src/Pig.cpp +++ b/src/Pig.cpp @@ -98,6 +98,12 @@ bool Pig::getDigits (int& result) return false; } +//////////////////////////////////////////////////////////////////////////////// +bool Pig::eos () const +{ + return _text[_cursor] == '\0'; +} + //////////////////////////////////////////////////////////////////////////////// std::string Pig::dump () const { diff --git a/src/Pig.h b/src/Pig.h index 93ee82c9..0886e6e3 100644 --- a/src/Pig.h +++ b/src/Pig.h @@ -39,6 +39,8 @@ public: bool getDigit (int&); bool getDigits (int&); + bool eos () const; + std::string dump () const; private: