using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Rdh.SocketServer.Client.Models
{
    public abstract class ModelProtocol
    {
        public virtual string AddBlockContent(string? content)
        {
            return content == null
                ? string.Empty
                : EleMedKitProtocolFlags.BlockSpiltor + content;
        }
        public abstract string GetContent();
        public virtual bool ParseContent(string content)
        {
            content = content.Trim().TrimStart(EleMedKitProtocolFlags.LineStart.First());
            return content.Length > 0;
        }
        public override string ToString()
        {
            return EleMedKitProtocolFlags.LineStart + GetContent() + EleMedKitProtocolFlags.LineEnd;
        }
    }
}
