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

A file. More...

#include <FTFile.hpp>

Collaboration diagram for samchon::library::FTFile:

Public Member Functions

 FTFile (FTFolder *)
 Construct from parent folder. More...
 
auto getExtension () const -> std::string
 Get extension. More...
 
virtual auto toXML () const -> std::shared_ptr< library::XML >
 Get an XML object represents the Entity. 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...
 
- Public Member Functions inherited from samchon::protocol::Entity
 Entity ()
 Default Constructor. More...
 
virtual void construct (std::shared_ptr< library::XML >)=0
 Construct data of the Entity from an XML object. More...
 

Protected Attributes

std::string extension
 An extension of a file. 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...
 

Additional Inherited Members

- Protected Member Functions inherited from samchon::library::FTInstance
virtual auto TAG () const -> std::string
 A tag name when represented by XML. More...
 

Detailed Description

A file.

An abstract class represents a file instance with extension.

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

Definition at line 20 of file FTFile.hpp.

Constructor & Destructor Documentation

FTFile::FTFile ( FTFolder parent)

Construct from parent folder.

Parameters
folderBelonged folder

Definition at line 12 of file FTFile.cpp.

References extension.

Member Function Documentation

auto FTFile::getExtension ( ) const -> std::string

Get extension.

Definition at line 23 of file FTFile.cpp.

References extension.

auto FTFile::toXML ( ) const -> std::shared_ptr<library::XML>
virtual

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.

Reimplemented in samchon::namtree::NTFile.

Definition at line 28 of file FTFile.cpp.

References extension, and samchon::library::FTInstance::toXML().

Referenced by samchon::namtree::NTFile::toXML().

Here is the call graph for this function:

Here is the caller graph for this function:

Member Data Documentation

std::string samchon::library::FTFile::extension
protected

An extension of a file.

FTFile's identifier is composited by name and extension.

Definition at line 31 of file FTFile.hpp.

Referenced by FTFile(), getExtension(), and toXML().


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