diff options
author | Eliot Horowitz <eliot@10gen.com> | 2010-04-27 13:18:06 -0400 |
---|---|---|
committer | Eliot Horowitz <eliot@10gen.com> | 2010-04-27 13:18:06 -0400 |
commit | 23bfd4eaacd938ef8308c3dbb1e1f27b43f922bf (patch) | |
tree | 09bea3aac50dbe4aac76872a768e07b67fc9be32 /util | |
parent | f466636958fd2a835d47408f76bbeb5af8926918 (diff) | |
download | mongo-23bfd4eaacd938ef8308c3dbb1e1f27b43f922bf.tar.gz |
line endings and compile
Diffstat (limited to 'util')
-rw-r--r-- | util/web/html.h | 82 |
1 files changed, 41 insertions, 41 deletions
diff --git a/util/web/html.h b/util/web/html.h index 1b62858b6cc..c194c80aedf 100644 --- a/util/web/html.h +++ b/util/web/html.h @@ -1,41 +1,41 @@ -// @file html.h
-
-#pragma once
-
-/* Things in the mongoutils namespace
- (1) are not database specific, rather, true utilities
- (2) are cross platform
- (3) may require boost headers, but not libs
- (4) are clean and easy to use in any c++ project without pulling in lots of other stuff
-*/
-
-#include <strstream>
-
-namespace mongoutils {
-
- namespace html {
-
- using namespace std;
-
- inline string p(string contentHtml) {
- stringstream ss;
- ss << "<p>" << contentHtml << "</p>\n";
- return ss.str();
- }
-
- /* does NOT escape the strings. */
- inline string a(string href, string title="", string contentHtml = "") {
- stringstream ss;
- ss << "<a";
- if( !href.empty() ) ss << " href=\"" << href << '"';
- if( !title.empty() ) ss << " title=\"" << title << '"';
- ss << '>';
- if( !contentHtml.empty() ) {
- ss << contentHtml << "</a>";
- }
- return ss.str();
- }
-
- }
-
-}
+// @file html.h + +#pragma once + +/* Things in the mongoutils namespace + (1) are not database specific, rather, true utilities + (2) are cross platform + (3) may require boost headers, but not libs + (4) are clean and easy to use in any c++ project without pulling in lots of other stuff +*/ + +#include <sstream> + +namespace mongoutils { + + namespace html { + + using namespace std; + + inline string p(string contentHtml) { + stringstream ss; + ss << "<p>" << contentHtml << "</p>\n"; + return ss.str(); + } + + /* does NOT escape the strings. */ + inline string a(string href, string title="", string contentHtml = "") { + stringstream ss; + ss << "<a"; + if( !href.empty() ) ss << " href=\"" << href << '"'; + if( !title.empty() ) ss << " title=\"" << title << '"'; + ss << '>'; + if( !contentHtml.empty() ) { + ss << contentHtml << "</a>"; + } + return ss.str(); + } + + } + +} |