import protobuf.type.scalar

namespace protobuf.type;
 
class string{ 

	ctor(...) {
		this = ..protobuf.type.scalar(...)
		this.wiredType = ..protobuf.message.wiredTypeLengthDelimited; 
	}
 
	deSerialize = function () { 
		this.value = this.reader.nextString();
	}
 
	serialize = function ( rec = -1 ) { 
		var str = '';

		if ( rec > -1) {
			str ++= this.encodeVarUint64( rec << 3 | this.wiredType );
		}
	
		var value = this.value; 
		str ++= this.encodeVarUint64( # value ); 
		str ++= (value:"");
		return str;
	}
}
