mirror of
https://github.com/Kitware/CMake.git
synced 2026-01-06 13:51:33 -06:00
Xcode: Use proper indentation for schemes
This commit is contained in:
@@ -47,6 +47,7 @@ void cmXCodeScheme::WriteXCodeXCScheme(std::ostream& fout,
|
||||
const std::string& xcProjDir)
|
||||
{
|
||||
cmXMLWriter xout(fout);
|
||||
xout.SetIndentationElement(std::string(3, ' '));
|
||||
xout.StartDocument();
|
||||
|
||||
xout.StartElement("Scheme");
|
||||
|
||||
@@ -7,6 +7,7 @@
|
||||
|
||||
cmXMLWriter::cmXMLWriter(std::ostream& output, std::size_t level)
|
||||
: Output(output)
|
||||
, IndentationElement(1, '\t')
|
||||
, Level(level)
|
||||
, ElementOpen(false)
|
||||
, BreakAttrib(false)
|
||||
@@ -100,10 +101,18 @@ void cmXMLWriter::FragmentFile(const char* fname)
|
||||
this->Output << fin.rdbuf();
|
||||
}
|
||||
|
||||
void cmXMLWriter::SetIndentationElement(std::string const& element)
|
||||
{
|
||||
this->IndentationElement = element;
|
||||
}
|
||||
|
||||
void cmXMLWriter::ConditionalLineBreak(bool condition, std::size_t indent)
|
||||
{
|
||||
if (condition) {
|
||||
this->Output << '\n' << std::string(indent + this->Level, '\t');
|
||||
this->Output << '\n';
|
||||
for (std::size_t i = 0; i < indent + this->Level; ++i) {
|
||||
this->Output << this->IndentationElement;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -60,6 +60,8 @@ public:
|
||||
|
||||
void FragmentFile(const char* fname);
|
||||
|
||||
void SetIndentationElement(std::string const& element);
|
||||
|
||||
private:
|
||||
cmXMLWriter(const cmXMLWriter&);
|
||||
cmXMLWriter& operator=(const cmXMLWriter&);
|
||||
@@ -107,6 +109,7 @@ private:
|
||||
private:
|
||||
std::ostream& Output;
|
||||
std::stack<std::string, std::vector<std::string> > Elements;
|
||||
std::string IndentationElement;
|
||||
std::size_t Level;
|
||||
bool ElementOpen;
|
||||
bool BreakAttrib;
|
||||
|
||||
Reference in New Issue
Block a user