#include <libsswf.h>
Public Member Functions | |
virtual ErrorManager::error_code_t | Save (Data &data) |
Save the TagMetadata tag. | |
void | SetAuthor (const char *description) |
Defines the name of the SWF animation (main) author. | |
void | SetCopyright (const char *copyright) |
Defines the legal information in regard to this SWF animation. | |
void | SetDescription (const char *description) |
Defines the description of the SWF animation. | |
void | SetFilename (const char *filename) |
Define the name of an XML file with the description. | |
void | SetMetadata (const char *xml) |
Set a string which represents the whole XML metadata. | |
void | SetPublisher (const char *publisher) |
Defines the name of the SWF animation publisher. | |
void | SetTitle (const char *title) |
Defines the title. | |
void | SetURL (const char *url) |
Defines a link to the source of the movie. | |
TagMetadata (TagBase *parent) | |
Initializes the TagMetadata object. | |
virtual swf_type_t | TypeFlags (void) const |
Return the type of the metadata tag. | |
Private Member Functions | |
virtual ErrorManager::error_code_t | ParseTag (swf_tag_t tag, const Data &data) |
virtual ErrorManager::error_code_t | PreSave (void) |
Inform the system that version 8 is required. | |
Private Attributes | |
char * | f_author |
char * | f_copyright |
char * | f_description |
char * | f_filename |
char * | f_publisher |
char * | f_title |
char * | f_url |
char * | f_xml |
The description needs to be saved in a valid XML format as described in my reference: Alexis' SWF Reference—Metadata You can also look at this .c++ file which can generate a simplified XML description file.
This tag should appear very early on in the SWF file so search engines which will use this information do not have to upload the entire file to find the metadata tag.
TagMetadata::TagMetadata | ( | TagBase * | parent | ) |
The constructor initializes a TagMetadata with no user description by default. If no description is added, then a default SSWF description is saved in the resulting SWF movie.
parent | The sswf::TagHeader where this sswf::TagMetadata is inserted |
References f_author, f_copyright, f_description, f_filename, f_publisher, f_title, f_url, and f_xml.
virtual ErrorManager::error_code_t sswf::TagMetadata::ParseTag | ( | swf_tag_t | tag, | |
const Data & | data | |||
) | [private, virtual] |
Implements sswf::TagBase.
ErrorManager::error_code_t TagMetadata::PreSave | ( | void | ) | [private, virtual] |
This function is used by the TagMetadata to tell the Save() command that to save this tag a version 8 movie is required.
Reimplemented from sswf::TagBase.
References sswf::ErrorManager::ERROR_CODE_NONE, and sswf::TagBase::MinimumVersion().
ErrorManager::error_code_t TagMetadata::Save | ( | Data & | data | ) | [virtual] |
This function saves the TagMetadata in the specified Data buffer.
The function creates the XML data for the TagMetadata tag and save the result in the data parameter.
The function tries to optimize the XML as much as possible.
Implements sswf::TagBase.
References sswf::ErrorManager::ERROR_CODE_FILE_NOT_FOUND, sswf::ErrorManager::ERROR_CODE_IO, sswf::ErrorManager::ERROR_CODE_NONE, f_author, f_copyright, f_description, f_filename, f_publisher, f_title, f_url, f_xml, is_space(), sswf::MemoryManager::MemAlloc(), sswf::MemoryManager::MemFree(), sswf::TagBase::OnError(), sswf::TagBase::SaveTag(), sswf::MemoryManager::StrCat(), sswf::MemoryManager::StrDup(), sswf::TagBase::SWF_TAG_METADATA, and sswf::Data::Write().
void TagMetadata::SetAuthor | ( | const char * | author | ) |
Define the name of the SWF animation author. Unfortunately, this function does no currently support more than one author name.
author | The name of the author; at this time, you can add multiple authors by adding semi-colon between names |
sswf::TagMetadata::SetDescription
References f_author, sswf::MemoryManager::MemFree(), and sswf::MemoryManager::StrDup().
void TagMetadata::SetCopyright | ( | const char * | copyright | ) |
Define legal information in link with the SWF animation. This is often a copyright statement including the year of publication.
This string can also defines the rights of the users in regard to this movie (i.e. free content, proprietary under patent, etc.)
copyright | The copyright in some humain language |
sswf::TagMetadata::SetDescription
References f_copyright, sswf::MemoryManager::MemFree(), and sswf::MemoryManager::StrDup().
void TagMetadata::SetDescription | ( | const char * | description | ) |
Define the SWF animation description. This can be a very long string. There is no limit imposed.
description | The description of the SWF animation |
sswf::TagMetadata::SetCopyright
References f_description, sswf::MemoryManager::MemFree(), and sswf::MemoryManager::StrDup().
void TagMetadata::SetFilename | ( | const char * | filename | ) |
This function can be used to define the name of a file holding the XML to be saved in the TagMetadata. The SSWF library will read the file at the time the tag is being saved.
The library does not check the content validity. You can use xmllint for that purpose.
filename | The name of an XML file to read for the metadata |
References f_filename, sswf::MemoryManager::MemFree(), and sswf::MemoryManager::StrDup().
void TagMetadata::SetMetadata | ( | const char * | xml | ) |
This function defines the entire XML metadata in one string. SSWF will directly save this string. At this time, SSWF does not check for the validity of the string.
xml | The direct XML as the description of the SWF animation |
References f_xml, sswf::MemoryManager::MemFree(), and sswf::MemoryManager::StrDup().
void TagMetadata::SetPublisher | ( | const char * | publisher | ) |
Define the name of the SWF animation publisher. This is often the name of the company the author is working with. If you create a movie for yourself, you can put your own name.
publisher | The name (and at times address, phone number, etc.) of the publisher |
sswf::TagMetadata::SetCopyright
References f_publisher, sswf::MemoryManager::MemFree(), and sswf::MemoryManager::StrDup().
void TagMetadata::SetTitle | ( | const char * | title | ) |
Define the SWF animation title.
title | The name or title of the SWF animation |
sswf::TagMetadata::SetCopyright
sswf::TagMetadata::SetDescription
References f_title, sswf::MemoryManager::MemFree(), and sswf::MemoryManager::StrDup().
void TagMetadata::SetURL | ( | const char * | url | ) |
Movies can easily be copied. This enables the search engines to know of the real source of the animation (until a hacker changes the URL, of course).
This should be your company or personal URL possibly directly to the page where the animation appears.
url | The standard URL link to a webpage |
sswf::TagMetadata::SetCopyright
sswf::TagMetadata::SetDescription
References f_url, sswf::MemoryManager::MemFree(), and sswf::MemoryManager::StrDup().
TagBase::swf_type_t TagMetadata::TypeFlags | ( | void | ) | const [virtual] |
This function returns the type flags of the TagMetadata. The TagMetadata is a control, needs to be unique and should be close to the start of the movie.
Implements sswf::TagBase.
References SWF_TYPE_CONTROL, SWF_TYPE_START, and SWF_TYPE_UNIQUE.
char* sswf::TagMetadata::f_author [private] |
Referenced by Save(), SetAuthor(), and TagMetadata().
char* sswf::TagMetadata::f_copyright [private] |
Referenced by Save(), SetCopyright(), and TagMetadata().
char* sswf::TagMetadata::f_description [private] |
Referenced by Save(), SetDescription(), and TagMetadata().
char* sswf::TagMetadata::f_filename [private] |
Referenced by Save(), SetFilename(), and TagMetadata().
char* sswf::TagMetadata::f_publisher [private] |
Referenced by Save(), SetPublisher(), and TagMetadata().
char* sswf::TagMetadata::f_title [private] |
Referenced by Save(), SetTitle(), and TagMetadata().
char* sswf::TagMetadata::f_url [private] |
Referenced by Save(), SetURL(), and TagMetadata().
char* sswf::TagMetadata::f_xml [private] |
Referenced by Save(), SetMetadata(), and TagMetadata().