Example #1
0
		bool Function::outputParametersMap(
			const ParametersMap& pm,
			ostream& stream,
			const string& tag,
			const string& xmlSchemaLocation,
			bool sorted,/* = true */
			const string& xmlUnsortedSchemaLocation /* = "" */
		) const {

			if(_outputFormat == MimeTypes::JSON)
			{
				if(sorted)
				{
					pm.outputJSON(
						stream,
						tag
					);
				}
				else
				{
					(*pm.getSubMaps(tag).begin())->outputJSON(
						stream,
						tag
					);
				}
			}
			else if(_outputFormat == MimeTypes::XML)
			{
				if(sorted)
				{
					pm.outputXML(
						stream,
						tag,
						true,
						xmlSchemaLocation
					);
				}
				else
				{
					(*pm.getSubMaps(tag).begin())->outputXML(
						stream,
						tag,
						true,
						xmlUnsortedSchemaLocation
					);
				}
			}
			else if(_outputFormat == MimeTypes::CSV)
			{
				pm.outputCSV(
					stream,
					tag
				);
			}
			else
			{
				return false;
			}

			return true;
		}