1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5 * Copyright 2008 by Sun Microsystems, Inc.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * $RCSfile: adc_msg.cxx,v $
12 * This file is part of OpenOffice.org.
14 * OpenOffice.org is free software: you can redistribute it and/or modify
15 * it under the terms of the GNU Lesser General Public License version 3
16 * only, as published by the Free Software Foundation.
18 * OpenOffice.org is distributed in the hope that it will be useful,
19 * but WITHOUT ANY WARRANTY; without even the implied warranty of
20 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 * GNU Lesser General Public License version 3 for more details
22 * (a copy is included in the LICENSE file that accompanied this code).
24 * You should have received a copy of the GNU Lesser General Public License
25 * version 3 along with OpenOffice.org. If not, see
26 * <http://www.openoffice.org/license.html>
27 * for a copy of the LGPLv3 License.
29 ************************************************************************/
32 #include <adc_msg.hxx>
35 // NOT FULLY DEFINED SERVICES
36 #include <cosv/file.hxx>
37 #include <cosv/tpl/tpltools.hxx>
47 aInvalidConstSymbols(),
49 aTypeVsMemberMisuses()
58 Messages::WriteFile(const String
& i_sOutputFilePath
)
61 aOut(i_sOutputFilePath
, csv::CFM_CREATE
);
64 // KORR_FUTURE Enable this when appropriate:
67 "Incompletely Parsed Files",
68 "Stopped parsing at " );
72 "Entities Without Documentation",
77 "Incorrectly Written Const Symbols",
87 "Confusion or Misuse of <Type> vs. <Member>",
93 Messages::Out_MissingDoc( const String
& i_sEntity
,
94 const String
& i_sFile
,
97 AddValue( aMissingDocs
,
104 Messages::Out_ParseError( const String
& i_sFile
,
107 aParseErrors
[Location(i_sFile
,i_nLine
)] = String::Null_();
111 Messages::Out_InvalidConstSymbol( const String
& i_sText
,
112 const String
& i_sFile
,
115 AddValue( aInvalidConstSymbols
,
122 Messages::Out_UnresolvedLink( const String
& i_sLinkText
,
123 const String
& i_sFile
,
126 AddValue( aUnresolvedLinks
,
133 Messages::Out_TypeVsMemberMisuse( const String
& i_sLinkText
,
134 const String
& i_sFile
,
137 AddValue( aTypeVsMemberMisuses
,
146 static Messages TheMessages_
;
151 Messages::AddValue( MessageMap
& o_dest
,
152 const String
& i_sText
,
153 const String
& i_sFile
,
157 rDest
= o_dest
[Location(i_sFile
,i_nLine
)];
160 if (NOT rDest
.empty())
162 slDest() << "\n " << i_sText
;
163 rDest
= slDest().c_str();
167 Messages::WriteParagraph( csv::File
& o_out
,
168 const MessageMap
& i_source
,
169 const String
& i_title
,
172 StreamStr
aLine(2000);
174 // Write title of paragraph:
177 o_out
.write(aLine
.c_str());
180 for (uintt i
= i_title
.size(); i
> 0; --i
)
185 o_out
.write(aLine
.c_str());
188 MessageMap::const_iterator it
= i_source
.begin();
189 MessageMap::const_iterator itEnd
= i_source
.end();
190 for ( ; it
!= itEnd
; ++it
)
193 aLine
<< (*it
).first
.sFile
;
194 // Nobody wants to see this, if we don't know the line:
195 if ((*it
).first
.nLine
!= 0)
198 << (*it
).first
.nLine
;
200 if (NOT (*it
).second
.empty())
206 o_out
.write(aLine
.c_str());
208 o_out
.write("\n\n\n");
211 } // namespace autodoc