DCL
3.7.4
Loading...
Searching...
No Matches
hse/HSAIDoc/main.cpp
Go to the documentation of this file.
1
#include <
dcl/Config.h
>
2
3
#ifdef __WINNT__
4
#include <windows.h>
5
#endif
6
7
#include <locale.h>
8
#include <wchar.h>
// wprintf
9
10
#include <
dcl/Charset.h
>
11
#include <
dcl/FileWriter.h
>
12
13
#include <
dcl/Files.h
>
14
15
#include "
DocSyntax.h
"
16
#include "
DocParser.h
"
17
#include "
HtmlGenerator.h
"
18
19
__DCL_USING_NAMESPACE
20
21
int
__main
(
int
argc,
char
* argv[])
22
{
23
FileWriter
out(
STDOUT_HANDLE
);
24
FileWriter
err(
STDERR_HANDLE
);
25
26
if
(argc < 3) {
27
err << L
"Usage: idoc filename idoc.ini"
<<
endl
28
<< L
"HSAIDocCmd.exe D:/Work/sdn/dcl/hse/HSAIDoc/main.cpp D:/Work/sdn/dcl/hse/HSAIDoc/src2html.ini"
29
<<
endl
;
30
return
0;
31
}
32
33
String filename = LocaleDecoder::decode(argv[1]);
34
String iniFilename = LocaleDecoder::decode(argv[2]);
35
36
if
(!
Files::exists
(filename)) {
37
err << L
"Source file is not found! - "
<< filename <<
endl
;
38
return
0;
39
}
40
41
if
(!
Files::exists
(iniFilename)) {
42
err << L
"Ini file is not found! - "
<< iniFilename <<
endl
;
43
return
0;
44
}
45
46
try
{
47
HtmlGenerator
gen(iniFilename);
48
49
gen.
generateHeader
(out, filename);
50
gen.
generate
(out, filename);
51
gen.
generateFooter
(out);
52
53
}
54
catch
(
Exception
* e) {
55
err << e->
toStringAll
();
56
e->
destroy
();
57
}
58
59
return
0;
60
}
61
62
int
main
(
int
argc,
char
* argv[])
63
{
64
int
r
= 0;
65
// std::locale::global(std::locale(""));
66
setlocale(LC_ALL,
""
);
67
68
__DCL_INITIALIZE
69
try
{
70
#ifdef __DCL_DEBUG
71
FileWriter
debugOut(
STDERR_HANDLE
);
72
DCLDebugSetGlobalReport(&debugOut);
73
try
{
74
#endif
75
76
r
=
__main
(argc, argv);
77
78
#ifdef __DCL_DEBUG
79
}
80
catch
(
Exception
* cause) {
81
debugOut << cause->
toStringAll
() <<
endl
;
82
cause->
destroy
();
83
}
84
#if __DCL_HAVE_ALLOC_DEBUG
85
DCLDebugDumpGlobalMemoryLeak(DCL_ALLOC_DUMP_ALL, &debugOut);
86
#endif
87
DCLDebugSetGlobalReport(
NULL
);
88
#endif
// __DCL_DEBUG
89
}
90
catch
(
Exception
* e) {
91
String s = e->
toStringAll
();
92
e->
destroy
();
93
wprintf(L
"Exception: %ls\n"
, s.data());
94
}
95
__DCL_CLEANUP
96
97
return
r
;
98
}
99
100
#ifdef __WINNT_NEW_DELETE_OVERRIDE
101
#undef new
102
__WINNT_NEW_DELETE_OVERRIDE
103
#endif
Charset.h
Config.h
NULL
#define NULL
Definition
Config.h:312
DocParser.h
DocSyntax.h
STDOUT_HANDLE
#define STDOUT_HANDLE
Definition
File.h:59
STDERR_HANDLE
#define STDERR_HANDLE
Definition
File.h:60
FileWriter.h
Files.h
HtmlGenerator.h
r
IOException *size_t r
Definition
MediaInfo.cpp:82
__DCL_CLEANUP
#define __DCL_CLEANUP
Definition
Object.h:286
__DCL_INITIALIZE
#define __DCL_INITIALIZE
Definition
Object.h:285
endl
DCLCVAR const struct __endl endl
Definition
OutputStream.cpp:66
Exception
Definition
Exception.h:26
Exception::destroy
virtual void destroy()
Definition
Exception.cpp:74
Exception::toStringAll
String toStringAll() const
Definition
Exception.cpp:45
FileWriter
Definition
FileWriter.h:24
Files::exists
static bool exists(const String &_path)
Definition
Files.cpp:109
HtmlGenerator
Definition
HtmlGenerator.h:25
HtmlGenerator::generateHeader
void generateHeader(Writer &out, const wchar_t *pszHtmlTitle=NULL)
Definition
HtmlGenerator.cpp:288
HtmlGenerator::generate
bool generate(Writer &out, const wchar_t *pszFileName, const wchar_t *pszLangSyntax=NULL)
Definition
HtmlGenerator.cpp:219
HtmlGenerator::generateFooter
void generateFooter(Writer &out)
Definition
HtmlGenerator.cpp:313
main
int main(int argc, char *argv[])
Definition
hse/HSAIDoc/main.cpp:62
__main
__DCL_USING_NAMESPACE int __main(int argc, char *argv[])
Definition
hse/HSAIDoc/main.cpp:21
hse
HSAIDoc
main.cpp
Generated by
1.14.0