TFCweb  1.0.4 $Rev: 483 $
TFC Primavera 2012: Nucli d'un servidor web
CosPeticio.h
Veure la documentació d'aquest fitxer.
1 #if !defined(_COS_PETICIO_H_)
2 #define _COS_PETICIO_H_
3 
11 /*
12  * Copyright (c) 2012 Toni Corvera
13  *
14  * This file is part of TFCWeb.
15  *
16  * TFCWeb is free software: you can redistribute it and/or modify
17  * it under the terms of the GNU General Public License as published by
18  * the Free Software Foundation, either version 3 of the License, or
19  * (at your option) any later version.
20  *
21  * TFCWeb is distributed in the hope that it will be useful,
22  * but WITHOUT ANY WARRANTY; without even the implied warranty of
23  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
24  * GNU General Public License for more details.
25  *
26  * You should have received a copy of the GNU General Public License
27  * along with TFCWeb. If not, see <http://www.gnu.org/licenses/>.
28  */
29 
30 #include <string>
31 
32 namespace tfc {
33 
38 class CosPeticio {
39 public:
46  explicit CosPeticio(size_t mida_esperada = 0);
49  : buffer_(c.buffer_)
50  {
51  // buit
52  }
55  buffer_ = c.buffer_;
56  return *this;
57  }
59  const std::string& contingut() const { return buffer_; }
61  void contingut(const std::string & dades);
63  size_t mida() const { return buffer_.length(); }
65  void afegeix(const std::string & dades);
71  void swap(std::string & dades);
72 private:
73  std::string buffer_;
74 };
75 
76 } // ns tfc
77 
78 #endif // _COS_PETICIO_H_
79 
80 // vim:set ts=4 et ai: //