1 // Written in the D programming language.
2 
3 /**
4 A type for representing the aname object of the 9P / Styx protocol. 
5 
6 Copyright: LightHouse Software, 2021
7 License:   $(HTTP https://github.com/aquaratixc/ESL-License, Experimental Software License 1.0).
8 Authors:   Oleg Bakharev,
9 		   Ilya Pertsev
10 */
11 module styx2000.protobj.aname;
12 
13 private {
14 	import std..string : format;
15 	
16 	import styx2000.protobj.styxobject;
17 	
18 	import styx2000.protobj.name;
19 }
20 
21 /**
22 	A class that provides a type for the aname field in some Styx messages. Inherits methods from the Name class and the StyxObject class. 
23 	See_Also:
24 		https://web.archive.org/web/20201029184954/https://powerman.name/Inferno/man/5/0intro.html
25 */
26 class Aname : Name
27 {
28 	/**
29 	A constructor that creates an object of the Aname class with the given parameter in the form of some string value representing aname. 
30 	If called without parameters, then the default parameter is empty string value. 
31     Params:
32     name = String value for selected file tree on server.
33     
34     Typical usage:
35     ----
36     Aname aname = new Aname(`test`);
37     ----
38     */
39 	this(string name = "")
40 	{
41 		super(name);
42 	}
43 	
44 	/// An alias that allows you to call a getter method without accessing the base Name class
45 	alias getAname = getName;
46 	/// An alias that allows you to call a setter method without accessing the base Name class	
47 	alias setAname = setName;	
48 	
49 	/// Convenient string representation of an object for printing 
50 	override string toString()
51 	{
52 		return format(
53 			`Aname(aname=%s)`, 
54 			_name == "" ? `""` : _name
55 		);
56 	}
57 	
58 	/// An alias for easier packing into a byte array without having to manually call the pack() method
59 	alias pack this;
60 }