#ifndef BINARYFILE_HPP_INCLUDED
#define BINARYFILE_HPP_INCLUDED

#include <iostream>
#include <memory>
#include <optional>
#include <set>
#include <string>
#include <vector>
#include <NBO/NBO/BinaryFile_Choice.h>
#include <NBO/NBO/NonNegativeLong_Type.h>
#include <NBO/NBO/ENBOType.h>
#include <NBO/NBOGlobal.h>
#include <NBO/Shared/Base/NBOBaseClass.h>


namespace Inscoper::NBO {

/*!
* \brief Represents the XML element BinaryFile.
*
* Size of the uncompressed file. [unit:bytes] 
*/
class NBO_EXPORT BinaryFile : public NBOBaseClass {

public:
	
	BinaryFile();
	~BinaryFile();

	/*!
	* \brief Cast a NBOBaseClass to a BinaryFile.
	*
	* \param base The base class to cast
	* \return The casted element, or nullptr if the cast fails
	*/
	static std::shared_ptr<BinaryFile> fromBase(NBOBaseClassPtr base);

	/*!
	* \brief Returns the class type name.
	*
	* \return The class type name
	*/
	std::string getTypeName() const override;

	/*!
	* \brief Returns the XML element name corresponding to this class.
	*
	* \return The XML element name
	*/
	std::string getXMLName() const override;

	/*!
	* \brief Returns the NBO Type corresponding to this class.
	*
	* \return The NBO Type value
	*/
	ENBOType getNBOType() const override;

	/*!
	* \brief Returns a list of all classes derived from this class.
	*
	* \return The list of derived classes
	*/
	std::vector<NBOBaseClassPtr> getChildren() const override;

	/*!
	* \brief Returns a list of all child elements contained in this class.
	*
	* \return The list of child classes
	*/
	std::vector<NBOBaseClassPtr> getSubElements() const override;

	/*!
	* \brief Populates this object from a JSON file.
	*
	* \param path The path to the JSON file
	* \param validate If true, validates constraints on value. Default is true.
	*/
	void fromJsonFile(const std::string& path, bool validate = true);

	/*!
	* \brief Populates this object from a JSON string.
	*
	* \param json_string The JSON content as a string
	* \param validate If true, validates constraints on value. Default is true.
	*/
	void fromJsonString(const std::string& json_string, bool validate = true);

	/*!
	* \brief Populates this object from a XML file.
	*
	* \param path The path to the XML file
	* \param validate If true, validates constraints on value. Default is true.
	*/
	void fromXmlFile(const std::string& path, bool validate = true);

	/*!
	* \brief Populates this object from a XML string.
	*
	* \param xml_string The XML content as a string
	* \param validate If true, validates constraints on value. Default is true.
	*/
	void fromXmlString(const std::string& xml_string, bool validate = true);

	/*!
	* \brief Serializes this object to an XML file.
	*
	* \param filename The path to the output XML file
	* \param validate If true, validates constraints on value. Default is true.
	*/
	void toXmlFile(const std::string& filename, bool validate = true) const;

	/*!
	* \brief Serializes this object to an XML string.
	*
	* \param validate If true, validates constraints on value. Default is true.
	* \return A string containing the XML representation of this object
	*/
	std::string toXmlString(bool validate = true) const;

	/*!
	* \brief Sets the value of the FileName attribute.
	*
	* No description available in the XSD standard.
	*
	* \param value The value to set
	* \param validate If true, validates constraints on value. Default is true.
	*/
	void setFileName(const std::string& value, bool validate = true);

	/*!
	* \brief Returns the value of the FileName attribute.
	*
	* No description available in the XSD standard.
	*
	* \return The value of the attribute
	*/
	std::string getFileName() const;

	/*!
	* \brief Resets the FileName attribute to an unset state.
	*
	* No description available in the XSD standard.
	*/
	void resetFileName();

	/*!
	* \brief Checks whether the FileName attribute is present.
	*
	* No description available in the XSD standard.
	*
	* \return true if the attribute has been set, false otherwise
	*/
	bool hasFileName() const;

	/*!
	* \brief Returns the allowed values for this attribut.
	*
	* No description available in the XSD standard.
	*
	* \return The list of allowed values
	*/
	static const std::set<std::string>& getFileNameAllowedValues();

	/*!
	* \brief Sets the value of the Size attribute.
	*
	* Size of the uncompressed file. [unit:bytes] 
	*
	* \param value The value to set
	* \param validate If true, validates constraints on value. Default is true.
	*/
	void setSize(const Inscoper::NBO::NonNegativeLong_TypePtr& value, bool validate = true);

	/*!
	* \brief Returns the value of the Size attribute.
	*
	* Size of the uncompressed file. [unit:bytes] 
	*
	* \return The value of the attribute
	*/
	NonNegativeLong_TypePtr getSize() const;

	/*!
	* \brief Resets the Size attribute to an unset state.
	*
	* Size of the uncompressed file. [unit:bytes] 
	*/
	void resetSize();

	/*!
	* \brief Checks whether the optional Size attribute is present.
	*
	* Size of the uncompressed file. [unit:bytes] 
	*
	* \return true if the optional attribute has been set, false otherwise
	*/
	bool hasSize() const;

	/*!
	* \brief Sets the value of the MIMEType attribute.
	*
	* No description available in the XSD standard.
	*
	* \param value The value to set
	* \param validate If true, validates constraints on value. Default is true.
	*/
	void setMIMEType(const std::string& value, bool validate = true);

	/*!
	* \brief Returns the value of the MIMEType attribute.
	*
	* No description available in the XSD standard.
	*
	* \return The value of the attribute
	*/
	std::string getMIMEType() const;

	/*!
	* \brief Resets the MIMEType attribute to an unset state.
	*
	* No description available in the XSD standard.
	*/
	void resetMIMEType();

	/*!
	* \brief Checks whether the MIMEType attribute is present.
	*
	* No description available in the XSD standard.
	*
	* \return true if the attribute has been set, false otherwise
	*/
	bool hasMIMEType() const;

	/*!
	* \brief Returns the allowed values for this attribut.
	*
	* No description available in the XSD standard.
	*
	* \return The list of allowed values
	*/
	static const std::set<std::string>& getMIMETypeAllowedValues();

	/*!
	* \brief Sets the value of the binaryfile_choice element.
	*
	* No description available in the XSD standard.
	*
	* \param value The value to set
	* \param validate If true, validates constraints on value. Default is true.
	*/
	void setbinaryfile_choice(const Inscoper::NBO::BinaryFile_ChoicePtr& value, bool validate = true);

	/*!
	* \brief Returns the value of the binaryfile_choice element.
	*
	* No description available in the XSD standard.
	*
	* \return The value of the element
	*/
	Inscoper::NBO::BinaryFile_ChoicePtr getbinaryfile_choice() const
;
	/*!
	* \brief Resets the binaryfile_choice element to an unset state.
	*
	* No description available in the XSD standard.
	*/
	void resetbinaryfile_choice();

	/*!
	* \brief Checks whether the optional binaryfile_choice element is present.
	*
	* No description available in the XSD standard.
	*
	* \return true if the optional attribute has been set, false otherwise
	*/
	bool hasbinaryfile_choice() const;


private:
	class Impl;
	std::unique_ptr<Impl> pImpl;

    std::optional<std::string> FileName; // Required attribute
    static const std::set<std::string> FileNameAllowedValues;
	NonNegativeLong_TypePtr Size = nullptr; // Required attribute
    std::optional<std::string> MIMEType; // Optional attribute
    static const std::set<std::string> MIMETypeAllowedValues;
    Inscoper::NBO::BinaryFile_ChoicePtr binaryfile_choice = nullptr;
};

/*! Shared pointer for BinaryFile*/
typedef std::shared_ptr<BinaryFile> BinaryFilePtr;

} // namespace Inscoper::NBO

#endif // BINARYFILE_HPP_INCLUDED