summaryrefslogtreecommitdiff
path: root/utils/tfstats/html.h
diff options
context:
space:
mode:
authorFluorescentCIAAfricanAmerican <[email protected]>2020-04-22 12:56:21 -0400
committerFluorescentCIAAfricanAmerican <[email protected]>2020-04-22 12:56:21 -0400
commit3bf9df6b2785fa6d951086978a3e66f49427166a (patch)
tree2c0f1f0c63c4832882bc93814ebd2c2b1c6224e5 /utils/tfstats/html.h
downloadarchived-source-engine-2018-hl2-src-master.tar.xz
archived-source-engine-2018-hl2-src-master.zip
Diffstat (limited to 'utils/tfstats/html.h')
-rw-r--r--utils/tfstats/html.h59
1 files changed, 59 insertions, 0 deletions
diff --git a/utils/tfstats/html.h b/utils/tfstats/html.h
new file mode 100644
index 0000000..05134a5
--- /dev/null
+++ b/utils/tfstats/html.h
@@ -0,0 +1,59 @@
+//========= Copyright Valve Corporation, All rights reserved. ============//
+//
+// Purpose: Interface of CHTMLFile.
+//
+// $Workfile: $
+// $Date: $
+//
+//------------------------------------------------------------------------------------------------------
+// $Log: $
+//
+// $NoKeywords: $
+//=============================================================================//
+
+#ifndef HTML_H
+#define HTML_H
+#ifdef WIN32
+#pragma once
+#endif
+#include <stdio.h>
+
+
+//------------------------------------------------------------------------------------------------------
+// Purpose: CHTMLFile represents an HTML text file that is being created. It has
+// some misc helper stuff, like writing the body tag for you, and linking to the style
+// sheet. Also some little helper functions to do <br>s and <p>s
+//------------------------------------------------------------------------------------------------------
+class CHTMLFile
+{
+public:
+ static const bool printBody;
+ static const bool dontPrintBody;
+ static const bool linkStyle;
+ static const bool dontLinkStyle;
+
+private:
+ FILE* out;
+ char filename[100];
+ bool fBody;
+public:
+ CHTMLFile():out(NULL),fBody(false){}
+
+ CHTMLFile(const char*filenm ,const char* title,bool fPrintBody=true,const char* bgimage=NULL,int leftmarg=0,int topmarg=20);
+ void open(const char*);
+
+ void write(PRINTF_FORMAT_STRING const char*,...);
+
+ void hr(int len=0,bool alignleft=false);
+ void br(){write("<br>\n");}
+ void p(){write("<p>\n");};
+ void img(const char* i){write("<img src=%s>\n",i);}
+
+ void div(const char* cls){write("<div class=%s>\n",cls);}
+ void div(){write("<div>\n");}
+ void enddiv(){write("</div>");}
+
+ void close();
+ ~CHTMLFile();
+};
+#endif // HTML_H