TFCweb  1.0.4 $Rev: 483 $
TFC Primavera 2012: Nucli d'un servidor web
CosPeticio.cc
Veure la documentació d'aquest fitxer.
1 
8 /*
9  * Copyright (c) 2012 Toni Corvera
10  *
11  * This file is part of TFCWeb.
12  *
13  * TFCWeb is free software: you can redistribute it and/or modify
14  * it under the terms of the GNU General Public License as published by
15  * the Free Software Foundation, either version 3 of the License, or
16  * (at your option) any later version.
17  *
18  * TFCWeb is distributed in the hope that it will be useful,
19  * but WITHOUT ANY WARRANTY; without even the implied warranty of
20  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21  * GNU General Public License for more details.
22  *
23  * You should have received a copy of the GNU General Public License
24  * along with TFCWeb. If not, see <http://www.gnu.org/licenses/>.
25  */
26 
27 #include "CosPeticio.h"
28 #include "Servidor.h"
29 
30 using namespace std;
31 
32 namespace tfc {
33 
34 CosPeticio::CosPeticio(size_t mida_esperada)
35  : buffer_()
36 {
37  if (mida_esperada > 0) {
38  buffer_.reserve(mida_esperada);
39  }
40 }
41 
42 void CosPeticio::contingut(const string & dades) {
43  buffer_ = dades;
44 }
45 
46 void CosPeticio::afegeix(const string & dades) {
47  buffer_.append(dades);
48 }
49 
50 void CosPeticio::swap(string & dades) {
51  buffer_.swap(dades);
52 }
53 
54 } // ns tfc
55 
56 // vim:set ts=4 et ai: //