コード例 #1
0
        public int Write(char[] chars, ref int offset)
        {
            StringBuilder sb = new StringBuilder(MaxTagLength);

            sb.Append('{');
            if (EnumCache <FFXIIITextTagCode> .IsDefined(Code))
            {
                sb.Append(Code);
            }
            else
            {
                sb.Append("Var").AppendFormat(((byte)Code).ToString("X2"));
            }
            if (Param != null)
            {
                sb.Append(' ');
                sb.Append(Param);
            }
            sb.Append('}');

            if (sb.Length > MaxTagLength)
            {
                throw Exceptions.CreateException(Lang.Error.Text.TooLongTagNameFormat, sb.ToString());
            }

            for (int i = 0; i < sb.Length; i++)
            {
                chars[offset++] = sb[i];
            }

            return(sb.Length);
        }
コード例 #2
0
        public override string ToString()
        {
            StringBuilder sb = new StringBuilder(MaxTagLength);

            sb.Append('{');
            if (EnumCache <FFXIIITextTagCode> .IsDefined(Code))
            {
                sb.Append(Code);
            }
            else
            {
                sb.Append("Var").AppendFormat(((byte)Code).ToString("X2"));
            }

            if (Param != null)
            {
                sb.Append(' ');
                sb.Append(Param);
            }
            sb.Append('}');
            return(sb.ToString());
        }