Update ooo320-m1
[ooovba.git] / autodoc / source / inc / adc_msg.hxx
blobffd627436c5f51f06aef2d40abf9abc5c4a88835
1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 *
5 * Copyright 2008 by Sun Microsystems, Inc.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * $RCSfile: adc_msg.hxx,v $
10 * $Revision: 1.4 $
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 ************************************************************************/
31 #ifndef ADC_ADC_MSG_HXX
32 #define ADC_ADC_MSG_HXX
36 // USED SERVICES
37 // BASE CLASSES
38 // COMPONENTS
39 // PARAMETERS
40 namespace csv
42 class File;
46 namespace autodoc
50 /** Gathers, sorts and displays (mainly diagnostic) messages to the
51 user of Autodoc.
53 class Messages
55 public:
56 // LIFECYCLE
57 Messages();
58 ~Messages();
59 // OPERATIONS
60 void WriteFile(
61 const String & i_sOutputFilePath);
62 // INQUIRY
64 // ACCESS
65 void Out_MissingDoc(
66 const String & i_sEntity,
67 const String & i_sFile,
68 uintt i_nLine);
69 void Out_ParseError(
70 const String & i_sFile,
71 uintt i_nLine);
72 void Out_InvalidConstSymbol(
73 const String & i_sText,
74 const String & i_sFile,
75 uintt i_nLine);
76 void Out_UnresolvedLink(
77 const String & i_sLinkText,
78 const String & i_sFile,
79 uintt i_nLine);
80 void Out_TypeVsMemberMisuse(
81 const String & i_sLinkText,
82 const String & i_sFile,
83 uintt i_nLine);
85 static Messages & The_();
87 private:
88 struct Location
90 String sFile;
91 uintt nLine;
93 Location(
94 const String & i_file,
95 uintt i_line)
96 : sFile(i_file),
97 nLine(i_line) {}
98 bool operator<(
99 const Location & i_other) const
100 { int cmp = csv::compare(sFile,i_other.sFile);
101 return cmp < 0
102 ? true
103 : cmp > 0
104 ? false
105 : nLine < i_other.nLine;
109 typedef std::map<Location,String> MessageMap;
111 // Locals
112 void AddValue(
113 MessageMap & o_dest,
114 const String & i_sText,
115 const String & i_sFile,
116 uintt i_nLine );
117 void WriteParagraph(
118 csv::File & o_out,
119 const MessageMap & i_source,
120 const String & i_title,
121 const String & i_firstIntermediateText );
123 // DATA
124 MessageMap aMissingDocs;
125 MessageMap aParseErrors;
126 MessageMap aInvalidConstSymbols;
127 MessageMap aUnresolvedLinks;
128 MessageMap aTypeVsMemberMisuses;
133 // IMPLEMENTATION
136 } // namespace autodoc
138 inline autodoc::Messages &
139 TheMessages()
141 return autodoc::Messages::The_();
144 #endif