1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*************************************************************************
4 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
6 * Copyright 2000, 2010 Oracle and/or its affiliates.
8 * OpenOffice.org - a multi-platform office productivity suite
10 * This file is part of OpenOffice.org.
12 * OpenOffice.org is free software: you can redistribute it and/or modify
13 * it under the terms of the GNU Lesser General Public License version 3
14 * only, as published by the Free Software Foundation.
16 * OpenOffice.org is distributed in the hope that it will be useful,
17 * but WITHOUT ANY WARRANTY; without even the implied warranty of
18 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19 * GNU Lesser General Public License version 3 for more details
20 * (a copy is included in the LICENSE file that accompanied this code).
22 * You should have received a copy of the GNU Lesser General Public License
23 * version 3 along with OpenOffice.org. If not, see
24 * <http://www.openoffice.org/license.html>
25 * for a copy of the LGPLv3 License.
27 ************************************************************************/
30 #include <adc_msg.hxx>
33 // NOT FULLY DEFINED SERVICES
34 #include <cosv/file.hxx>
35 #include <cosv/tpl/tpltools.hxx>
45 aInvalidConstSymbols(),
47 aTypeVsMemberMisuses()
56 Messages::WriteFile(const String
& i_sOutputFilePath
)
59 aOut(i_sOutputFilePath
, csv::CFM_CREATE
);
62 // KORR_FUTURE Enable this when appropriate:
65 "Incompletely Parsed Files" );
69 "Entities Without Documentation" );
73 "Incorrectly Written Const Symbols" );
81 "Confusion or Misuse of <Type> vs. <Member>" );
86 Messages::Out_MissingDoc( const String
& i_sEntity
,
87 const String
& i_sFile
,
90 AddValue( aMissingDocs
,
97 Messages::Out_ParseError( const String
& i_sFile
,
100 aParseErrors
[Location(i_sFile
,i_nLine
)] = String::Null_();
104 Messages::Out_InvalidConstSymbol( const String
& i_sText
,
105 const String
& i_sFile
,
108 AddValue( aInvalidConstSymbols
,
115 Messages::Out_UnresolvedLink( const String
& i_sLinkText
,
116 const String
& i_sFile
,
119 AddValue( aUnresolvedLinks
,
126 Messages::Out_TypeVsMemberMisuse( const String
& i_sLinkText
,
127 const String
& i_sFile
,
130 AddValue( aTypeVsMemberMisuses
,
139 static Messages TheMessages_
;
144 Messages::AddValue( MessageMap
& o_dest
,
145 const String
& i_sText
,
146 const String
& i_sFile
,
150 rDest
= o_dest
[Location(i_sFile
,i_nLine
)];
153 if (NOT rDest
.empty())
155 slDest() << "\n " << i_sText
;
156 rDest
= slDest().c_str();
160 Messages::WriteParagraph( csv::File
& o_out
,
161 const MessageMap
& i_source
,
162 const String
& i_title
)
164 StreamStr
aLine(2000);
166 // Write title of paragraph:
169 o_out
.write(aLine
.c_str());
172 for (uintt i
= i_title
.size(); i
> 0; --i
)
177 o_out
.write(aLine
.c_str());
180 MessageMap::const_iterator it
= i_source
.begin();
181 MessageMap::const_iterator itEnd
= i_source
.end();
182 for ( ; it
!= itEnd
; ++it
)
185 aLine
<< (*it
).first
.sFile
;
186 // Nobody wants to see this, if we don't know the line:
187 if ((*it
).first
.nLine
!= 0)
190 << (*it
).first
.nLine
;
192 if (NOT (*it
).second
.empty())
198 o_out
.write(aLine
.c_str());
200 o_out
.write("\n\n\n");
203 } // namespace autodoc
205 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */