1
/***************************************************************************
2
* Copyright (C) 2009 by The qGo Project *
4
* This file is part of qGo. *
6
* qGo is free software: you can redistribute it and/or modify *
7
* it under the terms of the GNU General Public License as published by *
8
* the Free Software Foundation; either version 2 of the License, or *
9
* (at your option) any later version. *
11
* This program is distributed in the hope that it will be useful, *
12
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
13
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
14
* GNU General Public License for more details. *
16
* You should have received a copy of the GNU General Public License *
17
* along with this program; if not, see <http://www.gnu.org/licenses/> *
18
* or write to the Free Software Foundation, Inc., *
19
* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
20
***************************************************************************/
23
#ifndef NEWLINE_PIPE_H
24
#define NEWLINE_PIPE_H
45
q.push_back(src[i++]);
47
void write(T * src, unsigned int max)
51
q.push_back(src[i++]);
53
unsigned int read(T * dst, unsigned int n)
56
unsigned int bytes = (n > q.size() ? q.size() : n);
58
{ dst[i++] = q.front(); q.pop_front(); }
62
unsigned int peek(T * dst, unsigned int n)
65
unsigned int bytes = (n > q.size() ? q.size() : n);
67
{ dst[i] = q[i]; i++;}
70
unsigned int readLine(T * dst, unsigned int max)
84
unsigned int canReadLine(void)
91
//else if(q[i] == '\r')
100
unsigned int canReadHTTPLine(void)
107
if(q[i - 3] == '\r' &&
119
unsigned int canRead(void)
127
#endif //NEWLINE_PIPE_H