1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
3 * This file is part of the LibreOffice project.
5 * This Source Code Form is subject to the terms of the Mozilla Public
6 * License, v. 2.0. If a copy of the MPL was not distributed with this
7 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
9 * This file incorporates work covered by the following license notice:
11 * Licensed to the Apache Software Foundation (ASF) under one or more
12 * contributor license agreements. See the NOTICE file distributed
13 * with this work for additional information regarding copyright
14 * ownership. The ASF licenses this file to you under the Apache
15 * License, Version 2.0 (the "License"); you may not use this file
16 * except in compliance with the License. You may obtain a copy of
17 * the License at http://www.apache.org/licenses/LICENSE-2.0 .
21 #include <adc_msg.hxx>
24 // NOT FULLY DEFINED SERVICES
25 #include <cosv/file.hxx>
26 #include <cosv/tpl/tpltools.hxx>
36 aInvalidConstSymbols(),
38 aTypeVsMemberMisuses()
47 Messages::WriteFile(const String
& i_sOutputFilePath
)
50 aOut(i_sOutputFilePath
, csv::CFM_CREATE
);
53 // KORR_FUTURE Enable this when appropriate:
56 "Incompletely Parsed Files" );
60 "Entities Without Documentation" );
64 "Incorrectly Written Const Symbols" );
72 "Confusion or Misuse of <Type> vs. <Member>" );
77 Messages::Out_MissingDoc( const String
& i_sEntity
,
78 const String
& i_sFile
,
81 AddValue( aMissingDocs
,
88 Messages::Out_ParseError( const String
& i_sFile
,
91 aParseErrors
[Location(i_sFile
,i_nLine
)] = String::Null_();
95 Messages::Out_InvalidConstSymbol( const String
& i_sText
,
96 const String
& i_sFile
,
99 AddValue( aInvalidConstSymbols
,
106 Messages::Out_UnresolvedLink( const String
& i_sLinkText
,
107 const String
& i_sFile
,
110 AddValue( aUnresolvedLinks
,
117 Messages::Out_TypeVsMemberMisuse( const String
& i_sLinkText
,
118 const String
& i_sFile
,
121 AddValue( aTypeVsMemberMisuses
,
130 static Messages TheMessages_
;
135 Messages::AddValue( MessageMap
& o_dest
,
136 const String
& i_sText
,
137 const String
& i_sFile
,
141 rDest
= o_dest
[Location(i_sFile
,i_nLine
)];
144 if (NOT rDest
.empty())
146 slDest() << "\n " << i_sText
;
147 rDest
= slDest().c_str();
151 Messages::WriteParagraph( csv::File
& o_out
,
152 const MessageMap
& i_source
,
153 const String
& i_title
)
155 StreamStr
aLine(2000);
157 // Write title of paragraph:
160 o_out
.write(aLine
.c_str());
163 for (uintt i
= i_title
.size(); i
> 0; --i
)
168 o_out
.write(aLine
.c_str());
171 MessageMap::const_iterator it
= i_source
.begin();
172 MessageMap::const_iterator itEnd
= i_source
.end();
173 for ( ; it
!= itEnd
; ++it
)
176 aLine
<< (*it
).first
.sFile
;
177 // Nobody wants to see this, if we don't know the line:
178 if ((*it
).first
.nLine
!= 0)
181 << (*it
).first
.nLine
;
183 if (NOT (*it
).second
.empty())
189 o_out
.write(aLine
.c_str());
191 o_out
.write("\n\n\n");
194 } // namespace autodoc
196 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */