Samchon Framework for CPP  1.0.0
samchon::library::FTFolder Class Reference

A folder. More...

#include <FTFolder.hpp>

Collaboration diagram for samchon::library::FTFolder:

Public Member Functions

 FTFolder (FTFactory *, FTFolder *)
 Construct from factory and parent folder. More...
 
virtual auto toXML () const -> std::shared_ptr< library::XML > override
 Get an XML object represents the Entity. More...
 
- Public Member Functions inherited from samchon::protocol::EntityGroup< _Container, _ETy, T >
 EntityGroup ()
 Default Constructor. More...
 
virtual void construct (std::shared_ptr< library::XML > xml)
 Construct data of the Entity from an XML object. More...
 
auto has (const std::string &key) const -> bool
 Indicates whether a container has an object having the specified identifier. More...
 
auto get (const std::string &key) -> value_type &
 Access the element by specified identifier(key). More...
 
auto get (const std::string &key) const -> const value_type &
 Access the const element by specified identifier(key). More...
 
- Public Member Functions inherited from samchon::protocol::Entity
 Entity ()
 Default Constructor. More...
 
- Public Member Functions inherited from samchon::protocol::IEntityGroup
 IEntityGroup ()
 Default Constructor. More...
 
- Public Member Functions inherited from samchon::library::FTInstance
 FTInstance (FTFolder *)
 Construct from parent folder. More...
 
virtual auto key () const -> std::string
 Get a key that can identify the Entity uniquely. More...
 
auto getUID () const -> int
 Get uid. More...
 
auto getParent () const -> FTFolder *
 Get parent folder. More...
 
auto getName () const -> std::string
 Get name. More...
 
auto getComment () const -> std::string
 Get comment. More...
 

Protected Member Functions

virtual auto CHILD_TAG () const -> std::string override
 A tag name of children. More...
 
- Protected Member Functions inherited from samchon::protocol::EntityGroup< _Container, _ETy, T >
virtual auto createChild (std::shared_ptr< library::XML >) -> entity_type *=0
 Factory method of a child Entity. More...
 
- Protected Member Functions inherited from samchon::library::FTInstance
virtual auto TAG () const -> std::string
 A tag name when represented by XML. More...
 

Protected Attributes

FTFactoryfactory
 Factory instance for creating sub files. More...
 
- Protected Attributes inherited from samchon::library::FTInstance
FTFolderparent
 Parent folder containing the instance. More...
 
int uid
 Key, an unique id of file. More...
 
std::string name
 Name of the file. More...
 
std::string comment
 Comment of the file. More...
 

Detailed Description

A folder.

A folder object has recursive and hierarchical relationship.

library_file_tree.png
See also
samchon::library
Author
Jeongho Nam http://samchon.org

Definition at line 23 of file FTFolder.hpp.

Constructor & Destructor Documentation

FTFolder::FTFolder ( FTFactory factory,
FTFolder parent 
)

Construct from factory and parent folder.

Parameters
factoryFactory instance
parentParent folder that this folder is belonged to

Definition at line 15 of file FTFolder.cpp.

References samchon::protocol::EntityGroup< _Container, _ETy, T >::construct(), samchon::library::FTFactory::createFile(), factory, and samchon::library::FTFactory::registerInstance().

Here is the call graph for this function:

Member Function Documentation

auto FTFolder::CHILD_TAG ( ) const -> std::string
overrideprotectedvirtual

A tag name of children.

< TAG>
     <CHILD_TAG />
     <CHILD_TAG />
</TAG>

Implements samchon::protocol::IEntityGroup.

Definition at line 13 of file FTFolder.cpp.

auto FTFolder::toXML ( ) const -> std::shared_ptr<library::XML>
overridevirtual

Get an XML object represents the Entity.

Returns an XML object that can represents the Entity containing member variables into properties.

A member variable (not object, but atomic value like number, string or date) is categorized as a property within the framework of entity side. Thus, when overriding a toXML() method and archiving member variables to an XML object to return, puts each variable to be a property belongs to only an XML object.

Don't archive the member variable of atomic value to XML::value causing enormouse creation of XML objects to number of member variables. An Entity must be represented by only an XML instance (tag).

Standard Usage Non-standard usage abusing value
<memberList>
     <member id='jhnam88' name='Jeongho+Nam' birthdate='1988-03-11' />
     <member id='master' name='Administartor' birthdate='2011-07-28' />
</memberList>
<member>
     <id>jhnam88</id>
     <name>Jeongho+Nam</name>
     <birthdate>1988-03-11</birthdate>
</member>
Returns
An XML object representing the Entity.

Reimplemented from samchon::library::FTInstance.

Definition at line 39 of file FTFolder.cpp.

References samchon::library::FTInstance::toXML(), and samchon::protocol::EntityGroup< _Container, _ETy, T >::toXML().

Here is the call graph for this function:

Member Data Documentation

FTFactory* samchon::library::FTFolder::factory
protected

Factory instance for creating sub files.

Definition at line 36 of file FTFolder.hpp.

Referenced by FTFolder().


The documentation for this class was generated from the following files: