STYLE: Fix line-too-long
[cmake.git] / Source / cmXCode21Object.cxx
blob83ce2679e7e34b2b57f0b280579f40161986e4f3
1 /*=========================================================================
3 Program: CMake - Cross-Platform Makefile Generator
4 Module: $RCSfile: cmXCode21Object.cxx,v $
5 Language: C++
6 Date: $Date: 2007-08-14 15:45:14 $
7 Version: $Revision: 1.7 $
9 Copyright (c) 2002 Kitware, Inc., Insight Consortium. All rights reserved.
10 See Copyright.txt or http://www.cmake.org/HTML/Copyright.html for details.
12 This software is distributed WITHOUT ANY WARRANTY; without even
13 the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
14 PURPOSE. See the above copyright notices for more information.
16 =========================================================================*/
17 #include "cmXCode21Object.h"
18 #include "cmSystemTools.h"
20 //----------------------------------------------------------------------------
21 cmXCode21Object::cmXCode21Object(PBXType ptype, Type type)
22 :cmXCodeObject(ptype, type)
24 this->Version = 21;
27 //----------------------------------------------------------------------------
28 void cmXCode21Object::PrintComment(std::ostream& out)
30 if(this->Comment.size() == 0)
32 cmXCodeObject* n = this->GetObject("name");
33 if(n)
35 this->Comment = n->GetString();
36 cmSystemTools::ReplaceString(this->Comment, "\"", "");
39 out << "/* ";
40 out << this->Comment;
41 out << " */";
44 //----------------------------------------------------------------------------
45 void cmXCode21Object::PrintList(std::vector<cmXCodeObject*> const& v,
46 std::ostream& out, PBXType t)
48 bool hasOne = false;
49 for(std::vector<cmXCodeObject*>::const_iterator i = v.begin();
50 i != v.end(); ++i)
52 cmXCodeObject* obj = *i;
53 if(obj->GetType() == OBJECT && obj->GetIsA() == t)
55 hasOne = true;
56 break;
59 if(!hasOne)
61 return;
63 out << "\n/* Begin " << PBXTypeNames[t] << " section */\n";
64 for(std::vector<cmXCodeObject*>::const_iterator i = v.begin();
65 i != v.end(); ++i)
67 cmXCodeObject* obj = *i;
68 if(obj->GetType() == OBJECT && obj->GetIsA() == t)
70 obj->Print(out);
73 out << "/* End " << PBXTypeNames[t] << " section */\n";
76 //----------------------------------------------------------------------------
77 void cmXCode21Object::PrintList(std::vector<cmXCodeObject*> const& v,
78 std::ostream& out)
80 cmXCodeObject::Indent(1, out);
81 out << "objects = {\n";
82 cmXCode21Object::PrintList(v, out, cmXCode21Object::PBXAggregateTarget);
83 cmXCode21Object::PrintList(v, out, cmXCode21Object::PBXBuildFile);
84 cmXCode21Object::PrintList(v, out, cmXCode21Object::PBXBuildStyle);
85 cmXCode21Object::PrintList(v, out, cmXCode21Object::PBXContainerItemProxy);
86 cmXCode21Object::PrintList(v, out, cmXCode21Object::PBXFileReference);
87 cmXCode21Object::PrintList(v, out,
88 cmXCode21Object::PBXFrameworksBuildPhase);
89 cmXCode21Object::PrintList(v, out, cmXCode21Object::PBXGroup);
90 cmXCode21Object::PrintList(v, out, cmXCode21Object::PBXHeadersBuildPhase);
91 cmXCode21Object::PrintList(v, out, cmXCode21Object::PBXNativeTarget);
92 cmXCode21Object::PrintList(v, out, cmXCode21Object::PBXProject);
93 cmXCode21Object::PrintList(v, out,
94 cmXCode21Object::PBXShellScriptBuildPhase);
95 cmXCode21Object::PrintList(v, out, cmXCode21Object::PBXResourcesBuildPhase);
96 cmXCode21Object::PrintList(v, out, cmXCode21Object::PBXSourcesBuildPhase);
97 cmXCode21Object::PrintList(v, out, cmXCode21Object::PBXCopyFilesBuildPhase);
98 cmXCode21Object::PrintList(v, out,
99 cmXCode21Object::PBXApplicationReference);
100 cmXCode21Object::PrintList(v, out,
101 cmXCode21Object::PBXExecutableFileReference);
102 cmXCode21Object::PrintList(v, out, cmXCode21Object::PBXLibraryReference);
103 cmXCode21Object::PrintList(v, out, cmXCode21Object::PBXToolTarget);
104 cmXCode21Object::PrintList(v, out, cmXCode21Object::PBXLibraryTarget);
105 cmXCode21Object::PrintList(v, out, cmXCode21Object::PBXTargetDependency);
106 cmXCode21Object::PrintList(v, out, cmXCode21Object::XCBuildConfiguration);
107 cmXCode21Object::PrintList(v, out, cmXCode21Object::XCConfigurationList);
108 cmXCodeObject::Indent(1, out);
109 out << "};\n";