Ejemplo n.º 1
0
////////////////////////
// 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;
}
Ejemplo n.º 2
0
////////////////////////
// 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;
}
Ejemplo n.º 3
0
///////////////////////
// Skips any blank characters
size_t StringBuf::skipBlank()
{
	size_t res = 0;
	while (!atEnd() && isspace((uchar)(*tPos))) {
		++res;
		incPos();
	}
	return res;
}
Ejemplo n.º 4
0
bool		readChar(char c)
{
  readWs();
  if (getCurrentByte() == c)
    {
      incPos();
      return (true);
    }
  return (false);
}
Ejemplo n.º 5
0
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);
}
Ejemplo n.º 6
0
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;
}
Ejemplo n.º 7
0
//--------------------utech--------------------utech--------------------utech--------------------
void UPostupForm::inc_pos()
{
	incPos();
}
Ejemplo n.º 8
0
bool		readAChar(void)
{
  readWs();
  incPos();
  return (true);
}