//////////////////////// // Reads until the specified character and skips it std::string StringBuf::readUntil(char c) { std::string res; while (!atEnd() && *tPos != c) { res += *tPos; incPos(); } // Skip the breaking character if (!atEnd()) incPos(); return res; }
//////////////////////// // Reads until one of the characters specified in char_array, NOT until the string in char_array std::string StringBuf::readUntil(const std::string& char_array) { std::string res; while (!atEnd() && char_array.find(*tPos) == std::string::npos) { res += *tPos; incPos(); } // Skip the breaking character if (!atEnd()) incPos(); return res; }
/////////////////////// // Skips any blank characters size_t StringBuf::skipBlank() { size_t res = 0; while (!atEnd() && isspace((uchar)(*tPos))) { ++res; incPos(); } return res; }
bool readChar(char c) { readWs(); if (getCurrentByte() == c) { incPos(); return (true); } return (false); }
bool readUntil(char cC, char cInhibitor) { int nSave; readWs(); nSave = getPos(); while (readEOF() == false) { readChar(cInhibitor); if (readChar(cC) == true) return (true); incPos(); } setPos(nSave); return (false); }
bool CircularBuffer::put(byte* buffer){ if (op==0){ op=1;//writing } else{ return false; } if (tail>=CIRCULARBUFFER_SIZE){ tail=0; } for (int i=0;i<_msgSize;i++){ _buf[tail]=buffer[i]; tail++; entries++; } if (entries>CIRCULARBUFFER_SIZE){ incPos(); entries=CIRCULARBUFFER_SIZE; } op=0; return true; }
//--------------------utech--------------------utech--------------------utech-------------------- void UPostupForm::inc_pos() { incPos(); }
bool readAChar(void) { readWs(); incPos(); return (true); }