Defines how to identify a world. More...
#include <WorldIdentifier.hh>
Public Member Functions | |
WorldIdentifier () | |
Constructor. More... | |
WorldIdentifier (const WorldIdentifier &_orig) | |
Copy Constructor. More... | |
~WorldIdentifier () | |
Destructor. More... | |
std::string | AsPrettyString (const std::string &_prefix="") const |
Returns all the available world information as a string using colors for better human parsing. More... | |
std::string | AsString (const std::string &_prefix="") const |
Returns all the world information as a string. Convenient for debugging. More... | |
std::string | LocalPath () const |
Returns a path to the world on disk if it is already cached. More... | |
std::string | Name () const |
Returns the world name. More... | |
WorldIdentifier & | operator= (const WorldIdentifier &_orig) |
Assignment operator. More... | |
bool | operator== (const WorldIdentifier &_rhs) const |
Equality operator. More... | |
std::string | Owner () const |
Returns owner to attribute world to. More... | |
bool | Private () const |
Returns the privacy setting of the world. More... | |
ServerConfig & | Server () const |
Returns server information to retrieve world from. More... | |
bool | SetLocalPath (const std::string &_path) |
Sets the path of the world in the local cache. More... | |
bool | SetName (const std::string &_name) |
Set the name of the world. More... | |
bool | SetOwner (const std::string &_name) |
Set the owner of the world. More... | |
void | SetPrivate (bool _private) |
Set the privacy setting of the world. More... | |
bool | SetServer (const ServerConfig &_server) |
Set the server from which this world comes. More... | |
bool | SetVersion (const unsigned int _version) |
Set the world's version. Versions are integers counting from 1. More... | |
bool | SetVersionStr (const std::string &_version) |
Set the world's version. Versions are integers counting from 1 or "tip" for the latest version. More... | |
std::string | UniqueName () const |
Returns a unique name for the world. More... | |
unsigned int | Version () const |
Returns the world's version as a number. Versions are integers counting from 1. Version zero means the tip. More... | |
std::string | VersionStr () const |
Returns the world's version as a string. Versions are integers counting from 1. The strings "tip" or "" mean the latest version. More... | |
Detailed Description
Defines how to identify a world.
Constructor & Destructor Documentation
◆ WorldIdentifier() [1/2]
WorldIdentifier | ( | ) |
Constructor.
◆ WorldIdentifier() [2/2]
WorldIdentifier | ( | const WorldIdentifier & | _orig | ) |
Copy Constructor.
- Parameters
-
[in] _orig WorldIdentifier to copy.
◆ ~WorldIdentifier()
~WorldIdentifier | ( | ) |
Destructor.
Member Function Documentation
◆ AsPrettyString()
std::string AsPrettyString | ( | const std::string & | _prefix = "" | ) | const |
Returns all the available world information as a string using colors for better human parsing.
- Parameters
-
[in] _prefix Optional prefix for every line of the string.
- Returns
- World information string
◆ AsString()
std::string AsString | ( | const std::string & | _prefix = "" | ) | const |
Returns all the world information as a string. Convenient for debugging.
- Parameters
-
[in] _prefix Optional prefix for every line of the string.
- Returns
- World information string
◆ LocalPath()
std::string LocalPath | ( | ) | const |
Returns a path to the world on disk if it is already cached.
- Returns
- Path, or empty string if the path has not been set
- See also
- SetLocalPath
◆ Name()
std::string Name | ( | ) | const |
Returns the world name.
- Returns
- World name.
◆ operator=()
WorldIdentifier& operator= | ( | const WorldIdentifier & | _orig | ) |
◆ operator==()
bool operator== | ( | const WorldIdentifier & | _rhs | ) | const |
Equality operator.
- Parameters
-
[in] _rhs WorldIdentifier to compare.
- Returns
- True if the WorldIdentifier names are equal.
◆ Owner()
std::string Owner | ( | ) | const |
Returns owner to attribute world to.
- Returns
- Owner name.
◆ Private()
bool Private | ( | ) | const |
Returns the privacy setting of the world.
- Returns
- True if the world is private, false if the world is public.
◆ Server()
ServerConfig& Server | ( | ) | const |
Returns server information to retrieve world from.
- Returns
- Server information.
◆ SetLocalPath()
bool SetLocalPath | ( | const std::string & | _path | ) |
◆ SetName()
bool SetName | ( | const std::string & | _name | ) |
Set the name of the world.
- Parameters
-
[in] _name The name to set.
- Returns
- True if successful.
◆ SetOwner()
bool SetOwner | ( | const std::string & | _name | ) |
Set the owner of the world.
- Parameters
-
[in] _name The name to set. Must be ascii and pass [-_a-z0-9]+
- Returns
- true if successful
◆ SetPrivate()
void SetPrivate | ( | bool | _private | ) |
Set the privacy setting of the world.
- Parameters
-
[in] _private True indicates the world is private, false indicates the world is public.
◆ SetServer()
bool SetServer | ( | const ServerConfig & | _server | ) |
Set the server from which this world comes.
- Parameters
-
[in] _server The server to retrieve the world from.
- Returns
- True if successful.
◆ SetVersion()
bool SetVersion | ( | const unsigned int | _version | ) |
Set the world's version. Versions are integers counting from 1.
- Parameters
-
[in] _version The world's version
- Returns
- True if successful.
- See also
- Version
- SetVersionStr
◆ SetVersionStr()
bool SetVersionStr | ( | const std::string & | _version | ) |
Set the world's version. Versions are integers counting from 1 or "tip" for the latest version.
- Parameters
-
[in] _version The world's version
- Returns
- True if successful.
- See also
- VersionStr
- SetVersion
◆ UniqueName()
std::string UniqueName | ( | ) | const |
Returns a unique name for the world.
- Remarks
- this is Server/Owner/Name.
- Returns
- Unique world name.
◆ Version()
unsigned int Version | ( | ) | const |
Returns the world's version as a number. Versions are integers counting from 1. Version zero means the tip.
- Returns
- World's version.
- See also
- VersionStr
- SetVersion
◆ VersionStr()
std::string VersionStr | ( | ) | const |
Returns the world's version as a string. Versions are integers counting from 1. The strings "tip" or "" mean the latest version.
- Returns
- World's version.
- See also
- Version
- SetVersionStr
The documentation for this class was generated from the following file: