|
1 /**************************************************************************** |
|
2 ** |
|
3 ** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). |
|
4 ** All rights reserved. |
|
5 ** Contact: Nokia Corporation (qt-info@nokia.com) |
|
6 ** |
|
7 ** This file is part of the qmake application of the Qt Toolkit. |
|
8 ** |
|
9 ** $QT_BEGIN_LICENSE:LGPL$ |
|
10 ** No Commercial Usage |
|
11 ** This file contains pre-release code and may not be distributed. |
|
12 ** You may use this file in accordance with the terms and conditions |
|
13 ** contained in the Technology Preview License Agreement accompanying |
|
14 ** this package. |
|
15 ** |
|
16 ** GNU Lesser General Public License Usage |
|
17 ** Alternatively, this file may be used under the terms of the GNU Lesser |
|
18 ** General Public License version 2.1 as published by the Free Software |
|
19 ** Foundation and appearing in the file LICENSE.LGPL included in the |
|
20 ** packaging of this file. Please review the following information to |
|
21 ** ensure the GNU Lesser General Public License version 2.1 requirements |
|
22 ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. |
|
23 ** |
|
24 ** In addition, as a special exception, Nokia gives you certain additional |
|
25 ** rights. These rights are described in the Nokia Qt LGPL Exception |
|
26 ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. |
|
27 ** |
|
28 ** If you have questions regarding the use of this file, please contact |
|
29 ** Nokia at qt-info@nokia.com. |
|
30 ** |
|
31 ** |
|
32 ** |
|
33 ** |
|
34 ** |
|
35 ** |
|
36 ** |
|
37 ** |
|
38 ** $QT_END_LICENSE$ |
|
39 ** |
|
40 ****************************************************************************/ |
|
41 |
|
42 #ifndef MSBUILD_OBJECTMODEL_H |
|
43 #define MSBUILD_OBJECTMODEL_H |
|
44 |
|
45 #include "project.h" |
|
46 #include "xmloutput.h" |
|
47 #include "msvc_objectmodel.h" |
|
48 #include <qatomic.h> |
|
49 #include <qlist.h> |
|
50 #include <qstring.h> |
|
51 #include <qstringlist.h> |
|
52 #include <qmap.h> |
|
53 #include <qdebug.h> |
|
54 |
|
55 QT_BEGIN_NAMESPACE |
|
56 |
|
57 |
|
58 class VCXConfiguration; |
|
59 class VCXProject; |
|
60 |
|
61 class VCXCLCompilerTool : public VCToolBase |
|
62 { |
|
63 public: |
|
64 // Functions |
|
65 VCXCLCompilerTool(); |
|
66 virtual ~VCXCLCompilerTool(){} |
|
67 bool parseOption(const char* option); |
|
68 |
|
69 // Variables |
|
70 QStringList AdditionalIncludeDirectories; |
|
71 QStringList AdditionalOptions; |
|
72 QStringList AdditionalUsingDirectories; |
|
73 QString AlwaysAppend; |
|
74 QString AssemblerListingLocation; |
|
75 QString AssemblerOutput; |
|
76 QString BasicRuntimeChecks; |
|
77 triState BrowseInformation; |
|
78 QString BrowseInformationFile; |
|
79 triState BufferSecurityCheck; |
|
80 QString CallingConvention; |
|
81 QString CompileAs; |
|
82 QString CompileAsManaged; |
|
83 triState CreateHotpatchableImage; |
|
84 QString DebugInformationFormat; |
|
85 triState DisableLanguageExtensions; |
|
86 QStringList DisableSpecificWarnings; |
|
87 QString EnableEnhancedInstructionSet; |
|
88 triState EnableFiberSafeOptimizations; |
|
89 triState EnablePREfast; |
|
90 QString ErrorReporting; |
|
91 QString ExceptionHandling; |
|
92 triState ExpandAttributedSource; |
|
93 QString FavorSizeOrSpeed; |
|
94 triState FloatingPointExceptions; |
|
95 QString FloatingPointModel; |
|
96 triState ForceConformanceInForLoopScope; |
|
97 QStringList ForcedIncludeFiles; |
|
98 QStringList ForcedUsingFiles; |
|
99 triState FunctionLevelLinking; |
|
100 triState GenerateXMLDocumentationFiles; |
|
101 triState IgnoreStandardIncludePath; |
|
102 QString InlineFunctionExpansion; |
|
103 triState IntrinsicFunctions; |
|
104 triState MinimalRebuild; |
|
105 triState MultiProcessorCompilation; |
|
106 QString ObjectFileName; |
|
107 QStringList ObjectFiles; |
|
108 triState OmitDefaultLibName; |
|
109 triState OmitFramePointers; |
|
110 triState OpenMPSupport; |
|
111 QString Optimization; |
|
112 QString PrecompiledHeader; |
|
113 QString PrecompiledHeaderFile; |
|
114 QString PrecompiledHeaderOutputFile; |
|
115 triState PreprocessKeepComments; |
|
116 QStringList PreprocessorDefinitions; |
|
117 QString PreprocessOutputPath; |
|
118 triState PreprocessSuppressLineNumbers; |
|
119 triState PreprocessToFile; |
|
120 QString ProgramDataBaseFileName; |
|
121 QString ProcessorNumber; |
|
122 QString RuntimeLibrary; |
|
123 triState RuntimeTypeInfo; |
|
124 triState ShowIncludes; |
|
125 triState SmallerTypeCheck; |
|
126 triState StringPooling; |
|
127 QString StructMemberAlignment; |
|
128 triState SuppressStartupBanner; |
|
129 QString TreatSpecificWarningsAsErrors; |
|
130 triState TreatWarningAsError; |
|
131 triState TreatWChar_tAsBuiltInType; |
|
132 triState UndefineAllPreprocessorDefinitions; |
|
133 QStringList UndefinePreprocessorDefinitions; |
|
134 triState UseFullPaths; |
|
135 triState UseUnicodeForAssemblerListing; |
|
136 QString WarningLevel; |
|
137 triState WholeProgramOptimization; |
|
138 QString XMLDocumentationFileName; |
|
139 |
|
140 VCXConfiguration* config; |
|
141 }; |
|
142 |
|
143 class VCXLinkerTool : public VCToolBase |
|
144 { |
|
145 public: |
|
146 // Functions |
|
147 VCXLinkerTool(); |
|
148 virtual ~VCXLinkerTool(){} |
|
149 bool parseOption(const char* option); |
|
150 |
|
151 // Variables |
|
152 QStringList AdditionalDependencies; |
|
153 QStringList AdditionalLibraryDirectories; |
|
154 QStringList AdditionalManifestDependencies; |
|
155 QStringList AdditionalOptions; |
|
156 QStringList AddModuleNamesToAssembly; |
|
157 triState AllowIsolation; |
|
158 triState AssemblyDebug; |
|
159 QStringList AssemblyLinkResource; |
|
160 QString BaseAddress; |
|
161 QString CLRImageType; |
|
162 QString CLRSupportLastError; |
|
163 QString CLRThreadAttribute; |
|
164 QString CLRUnmanagedCodeCheck; |
|
165 QString CreateHotPatchableImage; |
|
166 triState DataExecutionPrevention; |
|
167 QStringList DelayLoadDLLs; |
|
168 triState DelaySign; |
|
169 QString Driver; |
|
170 QStringList EmbedManagedResourceFile; |
|
171 triState EnableCOMDATFolding; |
|
172 triState EnableUAC; |
|
173 QString EntryPointSymbol; |
|
174 triState FixedBaseAddress; |
|
175 QString ForceFileOutput; |
|
176 QStringList ForceSymbolReferences; |
|
177 QString FunctionOrder; |
|
178 triState GenerateDebugInformation; |
|
179 triState GenerateManifest; |
|
180 triState GenerateMapFile; |
|
181 qlonglong HeapCommitSize; |
|
182 qlonglong HeapReserveSize; |
|
183 triState IgnoreAllDefaultLibraries; |
|
184 triState IgnoreEmbeddedIDL; |
|
185 triState IgnoreImportLibrary; |
|
186 QStringList IgnoreSpecificDefaultLibraries; |
|
187 triState ImageHasSafeExceptionHandlers; |
|
188 QString ImportLibrary; |
|
189 QString KeyContainer; |
|
190 QString KeyFile; |
|
191 triState LargeAddressAware; |
|
192 triState LinkDLL; |
|
193 QString LinkErrorReporting; |
|
194 triState LinkIncremental; |
|
195 triState LinkStatus; |
|
196 QString LinkTimeCodeGeneration; |
|
197 QString ManifestFile; |
|
198 triState MapExports; |
|
199 QString MapFileName; |
|
200 QString MergedIDLBaseFileName; |
|
201 QString MergeSections; |
|
202 QString MidlCommandFile; |
|
203 QString ModuleDefinitionFile; |
|
204 QString MSDOSStubFileName; |
|
205 triState NoEntryPoint; |
|
206 triState OptimizeReferences; |
|
207 QString OutputFile; |
|
208 triState PreventDllBinding; |
|
209 QString Profile; |
|
210 QString ProfileGuidedDatabase; |
|
211 QString ProgramDatabaseFile; |
|
212 triState RandomizedBaseAddress; |
|
213 triState RegisterOutput; |
|
214 qlonglong SectionAlignment; |
|
215 triState SetChecksum; |
|
216 QString ShowProgress; |
|
217 QString SpecifySectionAttributes; |
|
218 QString StackCommitSize; |
|
219 QString StackReserveSize; |
|
220 QString StripPrivateSymbols; |
|
221 QString SubSystem; |
|
222 triState SupportNobindOfDelayLoadedDLL; |
|
223 triState SupportUnloadOfDelayLoadedDLL; |
|
224 triState SuppressStartupBanner; |
|
225 triState SwapRunFromCD; |
|
226 triState SwapRunFromNet; |
|
227 QString TargetMachine; |
|
228 triState TerminalServerAware; |
|
229 triState TreatLinkerWarningAsErrors; |
|
230 triState TurnOffAssemblyGeneration; |
|
231 QString TypeLibraryFile; |
|
232 qlonglong TypeLibraryResourceID; |
|
233 QString UACExecutionLevel; |
|
234 triState UACUIAccess; |
|
235 QString Version; |
|
236 |
|
237 |
|
238 VCXConfiguration* config; |
|
239 }; |
|
240 |
|
241 class VCXMIDLTool : public VCToolBase |
|
242 { |
|
243 public: |
|
244 // Functions |
|
245 VCXMIDLTool(); |
|
246 virtual ~VCXMIDLTool(){} |
|
247 bool parseOption(const char* option); |
|
248 |
|
249 // Variables |
|
250 QStringList AdditionalIncludeDirectories; |
|
251 QStringList AdditionalOptions; |
|
252 triState ApplicationConfigurationMode; |
|
253 QString ClientStubFile; |
|
254 QString CPreprocessOptions; |
|
255 QString DefaultCharType; |
|
256 QString DLLDataFileName; |
|
257 QString EnableErrorChecks; |
|
258 triState ErrorCheckAllocations; |
|
259 triState ErrorCheckBounds; |
|
260 triState ErrorCheckEnumRange; |
|
261 triState ErrorCheckRefPointers; |
|
262 triState ErrorCheckStubData; |
|
263 QString GenerateClientFiles; |
|
264 QString GenerateServerFiles; |
|
265 triState GenerateStublessProxies; |
|
266 triState GenerateTypeLibrary; |
|
267 QString HeaderFileName; |
|
268 triState IgnoreStandardIncludePath; |
|
269 QString InterfaceIdentifierFileName; |
|
270 qlonglong LocaleID; |
|
271 triState MkTypLibCompatible; |
|
272 QString OutputDirectory; |
|
273 QStringList PreprocessorDefinitions; |
|
274 QString ProxyFileName; |
|
275 QString RedirectOutputAndErrors; |
|
276 QString ServerStubFile; |
|
277 QString StructMemberAlignment; |
|
278 triState SuppressCompilerWarnings; |
|
279 triState SuppressStartupBanner; |
|
280 QString TargetEnvironment; |
|
281 QString TypeLibFormat; |
|
282 QString TypeLibraryName; |
|
283 QStringList UndefinePreprocessorDefinitions; |
|
284 triState ValidateAllParameters; |
|
285 triState WarnAsError; |
|
286 QString WarningLevel; |
|
287 |
|
288 VCXConfiguration* config; |
|
289 }; |
|
290 |
|
291 class VCXLibrarianTool : public VCToolBase |
|
292 { |
|
293 public: |
|
294 // Functions |
|
295 VCXLibrarianTool(); |
|
296 virtual ~VCXLibrarianTool(){} |
|
297 bool parseOption(const char*){ return false; }; |
|
298 |
|
299 // Variables |
|
300 QStringList AdditionalDependencies; |
|
301 QStringList AdditionalLibraryDirectories; |
|
302 QStringList AdditionalOptions; |
|
303 QString DisplayLibrary; |
|
304 QString ErrorReporting; |
|
305 QStringList ExportNamedFunctions; |
|
306 QStringList ForceSymbolReferences; |
|
307 triState IgnoreAllDefaultLibraries; |
|
308 QStringList IgnoreSpecificDefaultLibraries; |
|
309 triState LinkTimeCodeGeneration; |
|
310 QString ModuleDefinitionFile; |
|
311 QString Name; |
|
312 QString OutputFile; |
|
313 QStringList RemoveObjects; |
|
314 QString SubSystem; |
|
315 triState SuppressStartupBanner; |
|
316 QString TargetMachine; |
|
317 triState TreatLibWarningAsErrors; |
|
318 triState Verbose; |
|
319 |
|
320 }; |
|
321 |
|
322 class VCXCustomBuildTool : public VCToolBase |
|
323 { |
|
324 public: |
|
325 // Functions |
|
326 VCXCustomBuildTool(); |
|
327 virtual ~VCXCustomBuildTool(){} |
|
328 bool parseOption(const char*){ return false; }; |
|
329 |
|
330 // Variables |
|
331 QStringList AdditionalDependencies; |
|
332 QStringList CommandLine; |
|
333 QString Description; |
|
334 QStringList Outputs; |
|
335 QString ToolName; |
|
336 QString ToolPath; |
|
337 QString ConfigName; |
|
338 }; |
|
339 |
|
340 class VCXResourceCompilerTool : public VCToolBase |
|
341 { |
|
342 public: |
|
343 // Functions |
|
344 VCXResourceCompilerTool(); |
|
345 virtual ~VCXResourceCompilerTool(){} |
|
346 bool parseOption(const char*){ return false; }; |
|
347 |
|
348 // Variables |
|
349 QStringList AdditionalIncludeDirectories; |
|
350 QString AdditionalOptions; |
|
351 QString Culture; |
|
352 triState IgnoreStandardIncludePath; |
|
353 triState NullTerminateStrings; |
|
354 QStringList PreprocessorDefinitions; |
|
355 QString ResourceOutputFileName; |
|
356 triState ShowProgress; |
|
357 triState SuppressStartupBanner; |
|
358 QString TrackerLogDirectory; |
|
359 QString UndefinePreprocessorDefinitions; |
|
360 }; |
|
361 |
|
362 class VCXDeploymentTool |
|
363 { |
|
364 public: |
|
365 // Functions |
|
366 VCXDeploymentTool(); |
|
367 virtual ~VCXDeploymentTool() {} |
|
368 |
|
369 // Variables |
|
370 QString DeploymentTag; |
|
371 QString RemoteDirectory; |
|
372 QString AdditionalFiles; |
|
373 }; |
|
374 |
|
375 class VCXEventTool : public VCToolBase |
|
376 { |
|
377 protected: |
|
378 // Functions |
|
379 VCXEventTool() : UseInBuild(unset){}; |
|
380 virtual ~VCXEventTool(){} |
|
381 bool parseOption(const char*){ return false; }; |
|
382 |
|
383 public: |
|
384 // Variables |
|
385 QString CommandLine; |
|
386 QString Description; |
|
387 triState UseInBuild; |
|
388 QString EventName; |
|
389 QString ToolPath; |
|
390 }; |
|
391 |
|
392 class VCXPostBuildEventTool : public VCXEventTool |
|
393 { |
|
394 public: |
|
395 VCXPostBuildEventTool(); |
|
396 ~VCXPostBuildEventTool(){} |
|
397 }; |
|
398 |
|
399 class VCXPreBuildEventTool : public VCXEventTool |
|
400 { |
|
401 public: |
|
402 VCXPreBuildEventTool(); |
|
403 ~VCXPreBuildEventTool(){} |
|
404 }; |
|
405 |
|
406 class VCXPreLinkEventTool : public VCXEventTool |
|
407 { |
|
408 public: |
|
409 VCXPreLinkEventTool(); |
|
410 ~VCXPreLinkEventTool(){} |
|
411 }; |
|
412 |
|
413 class VCXConfiguration |
|
414 { |
|
415 public: |
|
416 // Functions |
|
417 VCXConfiguration(); |
|
418 ~VCXConfiguration(){} |
|
419 |
|
420 // Variables |
|
421 triState ATLMinimizesCRunTimeLibraryUsage; |
|
422 triState BuildBrowserInformation; |
|
423 QString CharacterSet; |
|
424 QString ConfigurationType; |
|
425 QString DeleteExtensionsOnClean; |
|
426 QString ImportLibrary; |
|
427 QString IntermediateDirectory; |
|
428 QString Name; |
|
429 QString ConfigurationName; |
|
430 QString OutputDirectory; |
|
431 QString PrimaryOutput; |
|
432 QString ProgramDatabase; |
|
433 triState RegisterOutput; |
|
434 QString TargetName; |
|
435 QString UseOfATL; |
|
436 QString UseOfMfc; |
|
437 triState WholeProgramOptimization; |
|
438 |
|
439 // XML sub-parts |
|
440 VCXCLCompilerTool compiler; |
|
441 VCXLibrarianTool librarian; |
|
442 VCXLinkerTool linker; |
|
443 VCXMIDLTool idl; |
|
444 VCXResourceCompilerTool resource; |
|
445 VCXCustomBuildTool custom; |
|
446 VCXDeploymentTool deployment; // Not likely to be supported: http://msdn.microsoft.com/en-us/library/sa69he4t.aspx |
|
447 VCXPostBuildEventTool postBuild; |
|
448 VCXPreBuildEventTool preBuild; |
|
449 VCXPreLinkEventTool preLink; |
|
450 }; |
|
451 |
|
452 struct VCXFilterFile |
|
453 { |
|
454 VCXFilterFile() |
|
455 { excludeFromBuild = false; } |
|
456 VCXFilterFile(const QString &filename, bool exclude = false ) |
|
457 { file = filename; excludeFromBuild = exclude; } |
|
458 VCXFilterFile(const QString &filename, const QString &additional, bool exclude = false ) |
|
459 { file = filename; excludeFromBuild = exclude; additionalFile = additional; } |
|
460 bool operator==(const VCXFilterFile &other){ |
|
461 return file == other.file |
|
462 && additionalFile == other.additionalFile |
|
463 && excludeFromBuild == other.excludeFromBuild; |
|
464 } |
|
465 |
|
466 bool excludeFromBuild; |
|
467 QString file; |
|
468 QString additionalFile; // For tools like MOC |
|
469 }; |
|
470 |
|
471 class VcxprojGenerator; |
|
472 class VCXFilter |
|
473 { |
|
474 public: |
|
475 // Functions |
|
476 VCXFilter(); |
|
477 ~VCXFilter(){}; |
|
478 |
|
479 void addFile(const QString& filename); |
|
480 void addFile(const VCXFilterFile& fileInfo); |
|
481 void addFiles(const QStringList& fileList); |
|
482 bool addExtraCompiler(const VCXFilterFile &info); |
|
483 void modifyPCHstage(QString str); |
|
484 bool outputFileConfig(XmlOutput &xml, XmlOutput &xmlFilter, const QString &filename, const QString &filtername, bool fileAllreadyAdded); |
|
485 |
|
486 // Variables |
|
487 QString Name; |
|
488 QString Filter; |
|
489 QString Guid; |
|
490 triState ParseFiles; |
|
491 VcxprojGenerator* Project; |
|
492 VCXConfiguration* Config; |
|
493 QList<VCXFilterFile> Files; |
|
494 |
|
495 customBuildCheck CustomBuild; |
|
496 |
|
497 bool useCustomBuildTool; |
|
498 VCXCustomBuildTool CustomBuildTool; |
|
499 |
|
500 bool useCompilerTool; |
|
501 VCXCLCompilerTool CompilerTool; |
|
502 }; |
|
503 |
|
504 typedef QList<VCXFilter> VCXFilterList; |
|
505 class VCXProjectSingleConfig |
|
506 { |
|
507 public: |
|
508 enum FilterTypes { |
|
509 None, |
|
510 Source, |
|
511 Header, |
|
512 Generated, |
|
513 LexYacc, |
|
514 Translation, |
|
515 Resources, |
|
516 Extras |
|
517 }; |
|
518 // Functions |
|
519 VCXProjectSingleConfig(){}; |
|
520 ~VCXProjectSingleConfig(){} |
|
521 |
|
522 // Variables |
|
523 QString Name; |
|
524 QString Version; |
|
525 QString ProjectGUID; |
|
526 QString Keyword; |
|
527 QString SccProjectName; |
|
528 QString SccLocalPath; |
|
529 QString PlatformName; |
|
530 |
|
531 // XML sub-parts |
|
532 VCXConfiguration Configuration; |
|
533 VCXFilter RootFiles; |
|
534 VCXFilter SourceFiles; |
|
535 VCXFilter HeaderFiles; |
|
536 VCXFilter GeneratedFiles; |
|
537 VCXFilter LexYaccFiles; |
|
538 VCXFilter TranslationFiles; |
|
539 VCXFilter FormFiles; |
|
540 VCXFilter ResourceFiles; |
|
541 VCXFilterList ExtraCompilersFiles; |
|
542 |
|
543 bool flat_files; |
|
544 |
|
545 // Accessor for extracompilers |
|
546 VCXFilter &filterForExtraCompiler(const QString &compilerName); |
|
547 }; |
|
548 |
|
549 |
|
550 |
|
551 // Tree & Flat view of files -------------------------------------------------- |
|
552 class VCXFilter; |
|
553 class XNode |
|
554 { |
|
555 public: |
|
556 virtual ~XNode() { } |
|
557 void addElement(const VCXFilterFile &file) { |
|
558 addElement(file.file, file); |
|
559 } |
|
560 virtual void addElement(const QString &filepath, const VCXFilterFile &allInfo) = 0; |
|
561 virtual void removeElements()= 0; |
|
562 virtual void generateXML(XmlOutput &xml, XmlOutput &xmlFilter, const QString &tagName, VCXProject &tool, const QString &filter) = 0; |
|
563 virtual bool hasElements() = 0; |
|
564 }; |
|
565 |
|
566 class XTreeNode : public XNode |
|
567 { |
|
568 typedef QMap<QString, XTreeNode*> ChildrenMap; |
|
569 VCXFilterFile info; |
|
570 ChildrenMap children; |
|
571 |
|
572 public: |
|
573 virtual ~XTreeNode() { removeElements(); } |
|
574 |
|
575 int pathIndex(const QString &filepath) { |
|
576 int Windex = filepath.indexOf("\\"); |
|
577 int Uindex = filepath.indexOf("/"); |
|
578 if (Windex != -1 && Uindex != -1) |
|
579 return qMin(Windex, Uindex); |
|
580 else if (Windex != -1) |
|
581 return Windex; |
|
582 return Uindex; |
|
583 } |
|
584 |
|
585 void addElement(const QString &filepath, const VCXFilterFile &allInfo){ |
|
586 QString newNodeName(filepath); |
|
587 |
|
588 int index = pathIndex(filepath); |
|
589 if (index != -1) |
|
590 newNodeName = filepath.left(index); |
|
591 |
|
592 XTreeNode *n = children.value(newNodeName); |
|
593 if (!n) { |
|
594 n = new XTreeNode; |
|
595 n->info = allInfo; |
|
596 children.insert(newNodeName, n); |
|
597 } |
|
598 if (index != -1) |
|
599 n->addElement(filepath.mid(index+1), allInfo); |
|
600 } |
|
601 |
|
602 void removeElements() { |
|
603 ChildrenMap::ConstIterator it = children.constBegin(); |
|
604 ChildrenMap::ConstIterator end = children.constEnd(); |
|
605 for( ; it != end; it++) { |
|
606 (*it)->removeElements(); |
|
607 delete it.value(); |
|
608 } |
|
609 children.clear(); |
|
610 } |
|
611 |
|
612 void generateXML(XmlOutput &xml, XmlOutput &xmlFilter, const QString &tagName, VCXProject &tool, const QString &filter); |
|
613 bool hasElements() { |
|
614 return children.size() != 0; |
|
615 } |
|
616 }; |
|
617 |
|
618 class XFlatNode : public XNode |
|
619 { |
|
620 typedef QMap<QString, VCXFilterFile> ChildrenMapFlat; |
|
621 ChildrenMapFlat children; |
|
622 |
|
623 public: |
|
624 virtual ~XFlatNode() { removeElements(); } |
|
625 |
|
626 int pathIndex(const QString &filepath) { |
|
627 int Windex = filepath.lastIndexOf("\\"); |
|
628 int Uindex = filepath.lastIndexOf("/"); |
|
629 if (Windex != -1 && Uindex != -1) |
|
630 return qMax(Windex, Uindex); |
|
631 else if (Windex != -1) |
|
632 return Windex; |
|
633 return Uindex; |
|
634 } |
|
635 |
|
636 void addElement(const QString &filepath, const VCXFilterFile &allInfo){ |
|
637 QString newKey(filepath); |
|
638 |
|
639 int index = pathIndex(filepath); |
|
640 if (index != -1) |
|
641 newKey = filepath.mid(index+1); |
|
642 |
|
643 // Key designed to sort files with same |
|
644 // name in different paths correctly |
|
645 children.insert(newKey + "\0" + allInfo.file, allInfo); |
|
646 } |
|
647 |
|
648 void removeElements() { |
|
649 children.clear(); |
|
650 } |
|
651 |
|
652 void generateXML(XmlOutput &xml, XmlOutput &xmlFilter, const QString &tagName, VCXProject &proj, const QString &filter); |
|
653 bool hasElements() { |
|
654 return children.size() != 0; |
|
655 } |
|
656 }; |
|
657 // ---------------------------------------------------------------------------- |
|
658 |
|
659 class VCXProject |
|
660 { |
|
661 public: |
|
662 // Variables |
|
663 QString Name; |
|
664 QString Version; |
|
665 QString ProjectGUID; |
|
666 QString Keyword; |
|
667 QString SccProjectName; |
|
668 QString SccLocalPath; |
|
669 QString PlatformName; |
|
670 |
|
671 // Single projects |
|
672 QList<VCXProjectSingleConfig> SingleProjects; |
|
673 |
|
674 // List of all extracompilers |
|
675 QStringList ExtraCompilers; |
|
676 |
|
677 // Functions |
|
678 void outputFilter(XmlOutput &xml, |
|
679 XmlOutput &xmlFilter, |
|
680 const QString &filtername); |
|
681 |
|
682 void outputFileConfigs(XmlOutput &xml, |
|
683 XmlOutput &xmlFilter, |
|
684 const VCXFilterFile &info, |
|
685 const QString &filtername); |
|
686 |
|
687 void addFilters(XmlOutput &xmlFilter, |
|
688 const QString &filtername); |
|
689 |
|
690 }; |
|
691 |
|
692 |
|
693 XmlOutput &operator<<(XmlOutput &, const VCXCLCompilerTool &); |
|
694 XmlOutput &operator<<(XmlOutput &, const VCXLinkerTool &); |
|
695 XmlOutput &operator<<(XmlOutput &, const VCXMIDLTool &); |
|
696 XmlOutput &operator<<(XmlOutput &, const VCXCustomBuildTool &); |
|
697 XmlOutput &operator<<(XmlOutput &, const VCXLibrarianTool &); |
|
698 XmlOutput &operator<<(XmlOutput &, const VCXResourceCompilerTool &); |
|
699 XmlOutput &operator<<(XmlOutput &, const VCXEventTool &); |
|
700 XmlOutput &operator<<(XmlOutput &, const VCXDeploymentTool &); |
|
701 XmlOutput &operator<<(XmlOutput &, const VCXConfiguration &); |
|
702 XmlOutput &operator<<(XmlOutput &, const VCXProjectSingleConfig &); |
|
703 XmlOutput &operator<<(XmlOutput &, VCXProject &); |
|
704 |
|
705 |
|
706 QT_END_NAMESPACE |
|
707 |
|
708 #endif // MSVC_OBJECTMODEL_H |