bitz-server  2.0.1
src/bitz/util.h
1 /*
2  * bitz-server, An ICAP server implementation in C++
3  * Copyright (C) 2012 Uditha Atukorala
4  *
5  * This program is free software; you can redistribute it and/or modify
6  * it under the terms of the GNU General Public License as published by
7  * the Free Software Foundation; either version 3 of the License, or
8  * (at your option) any later version.
9  *
10  * This program is distributed in the hope that it will be useful,
11  * but WITHOUT ANY WARRANTY; without even the implied warranty of
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13  * GNU General Public License for more details.
14  *
15  * You should have received a copy of the GNU General Public License
16  * along with this program; if not, write to the Free Software
17  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
18  */
19 
20 #ifndef BITZ_UTIL_H
21 #define BITZ_UTIL_H
22 
23 #include "common.h"
24 
25 #include <string>
26 #include <sstream>
27 
28 
29 namespace bitz {
30 
31  namespace util {
32 
39  template <typename T> std::string itoa( T number ) {
40  std::ostringstream ss;
41  ss << number;
42 
43  return ss.str();
44  }
45 
53  RequestHandler * find_req_handler( req_handlers_t req_handlers, const std::string &req_method ) throw();
54 
61  void delete_req_handlers( req_handlers_t req_handlers ) throw();
62 
69  std::string dirpath( const std::string &path ) throw();
70 
77  std::string filename( const std::string &path ) throw();
78 
85  bool mkdirp( const std::string &path ) throw();
86 
87  } /* end of namespace util */
88 
89 } /* end of namespace bitz */
90 
91 #endif /* !BITZ_UTIL_H */
92 
Definition: echo.cpp:23