Ejemplo n.º 1
0
	void CompoundWriter::buildNamespace()
	{
		if (pCompound->name.find_first_of("<@") != String::npos)
			return;

		String filename;
		filename << Options::target << SEP << pCompound->htdocs;
		if (!IO::Directory::Create(filename))
			return;
		filename << SEP << "article.xml";

		IO::File::Stream file;
		if (file.openRW(filename))
		{
			// Getting the name
			const String& name = pCompound->name;

			file << "<title>";
			String::Size offset = name.find_last_of(":\\/");
			if (offset < name.size() && offset + 1 < name.size())
				file.write(name.c_str() + offset + 1, name.size() - (offset + 1));
			else
				file << name;
			file << "</title>\n";
			file << "<pragma:weight value=\"0.40\" />\n";
			file << "<tag name=\"doxygen\" />\n";
			file << "<tag name=\"dox:namespace\" />\n";
			file << "\n\n";
		}
	}
Ejemplo n.º 2
0
	void CompoundWriter::buildClass()
	{
		if (pCompound->name.find_first_of("<@") != String::npos)
			return;

		String filename;
		filename << Options::target << SEP << pCompound->htdocs;
		if (!IO::Directory::Create(filename))
			return;
		filename << SEP << "article.xml";


		IO::File::Stream file;
		if (file.openRW(filename))
		{
			// Getting the name
			const String& name = pCompound->name;

			fileOut.clear();

			String pageTitle;
			{
				String tmp;
				String::Size offset = name.find_last_of(":\\/");
				if (offset < name.size() && offset + 1 < name.size())
					pageTitle.append(name.c_str() + offset + 1, name.size() - (offset + 1));
				else
					pageTitle << name;
				PrepareTitle(tmp, pageTitle);
				fileOut << "<title>" << tmp << "</title>\n";
				fileOut << "<pragma:weight value=\"0.5\" />\n";
				fileOut << "<pragma:toc visible=\"false\" />\n";
				fileOut << "<tag name=\"doxygen\" />\n";
				fileOut << "<tag name=\"dox:class\" />\n";
				fileOut << "\n\n\n";

				fileOut << "<h2>";
				if (not pCompound->brief.empty())
					PrepareTitle(tmp, pCompound->brief);
				else
					PrepareTitle(tmp, pageTitle);
				// in some cases, a final point is in the string, and it is not especially beautiful
				fileOut << tmp;
				fileOut << "</h2>\n";
			}

			bool isAbstract = (pageTitle.first() == 'I');

			OrderedSection sectionmap;
			buildSectionMapping(sectionmap, isAbstract);

			if (!sectionmap.empty())
			{
				// resetting temporary stream outputs
				out.clear();
				for (uint i = 0; i != 2; ++i)
				{
					for (uint j = 0; j != (uint) kdMax; ++j)
						outC[i][j].clear();
				}

				// Starting the table
				out << "<table class=\"doxygen_table\">\n";

				// iterating through all sections found
				OrderedSection::const_iterator end = sectionmap.end();
				for (OrderedSection::const_iterator i = sectionmap.begin(); i != end; ++i)
				{
					// Append all sections found
					Section::Vector::const_iterator send = i->second.end();
					for (Section::Vector::const_iterator j = i->second.begin(); j != send; ++j)
						appendClassSection(/*section*/ *(*j), isAbstract);
				}

				// End of table
				out << "</table>\n\n\n";
			}

			// Writing the begining of the article (title...)
			file << fileOut;

			// Preparing indexes from temporary buffers
			fileOut.clear();
			for (uint i = 1; i < 2; --i)
			{
				for (uint j = 0; j != (uint) kdMax; ++j)
				{
					if (not outC[i][j].empty())
						appendClassIndex(fileOut, (i != 0) /*isPublic*/, (CompoundType) j, outC[i][j]);
				}
			}

			if (not fileOut.empty())
				fileOut << "<h2>Detailed Description</h2>";

			if (not pCompound->description.empty())
			{
				fileOut << "<div>" << pCompound->description
					<< "</div><div style=\"margin-top:3em;border:1px solid #aaa;border-bottom-style:none;border-left-style:none;border-right-style:none\"></div>\n";
			}

			// Writing indexes
			file << fileOut;
			// Writing detailed description
			file << out;
		}
	}