[Verse-dev] Verse 2.0 Specification

Jiri Hnidek jiri.hnidek at tul.cz
Tue Sep 13 10:01:59 CEST 2011


Hi Oleg,
this documentation is a little bit out of date. This part of
specification:

http://dev.nti.tul.cz/trac/verse2/wiki/Specification#Strings

covers concept of string encoding. Right now all commands in described
in specification uses only string8. Specification of command has to
explicitly say, what type of string is used. Example: TagGroup_Create
command uses string8 for TagGroup name:

 0                   1         1         2     2             3
 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 
+---------------+
|   OpCode=48   |
+---------------+
|    Length     |
+---------------+
|  Share=0/4/6  |
+---------------+---------------+---------------+---------------+
|                           Node ID                             |*
+---------------+---------------+---------------+---------------+
|          TagGroup ID          |*
+---------------+---------------+
|            Tag ID             |
+---------------+---------------+
|     Type      |
+---------------+---------------+---...   ...---+---------------+
| String Length |                  Tag Name ...                 |
+---------------+---------------+---...   ...---+---------------+

No command need to use string longer then 255 characters right now. So
string16 and string32 are only theoretical concepts now.

Anyway. Two first bytes in string16 represents length of the string. So,
maximal length of string16 is 2^16-1.

 +---+---+---+---+---+
 | 0 | 3 | j | o | e |
 +---+---+---+---+---+

I know about Google Protocol Buffers. I like it, but I do not use it for
several reasons. It doesn't allow to use command address compression. It
generates C++ api. Generated source code is huge and you can't write to
specification: use Google Protocol Buffers technology. ;-)

Best Regards,

Jiri

Oleg Ageyev píše v Út 13. 09. 2011 v 02:46 +0400:
> Hello,
> I have some questions about Verse 2 Specification
> http://dev.nti.tul.cz/trac/verse2/wiki/Specification
> 1) Strings
> > string8: unsigned char, array of chars without terminating char '\0'
> > string16: unsigned short, array of chars without terminating char '\0'
> > string32: unsigned int, array of chars without terminating char '\0'
> 
> this means that string8 is ANSI string (array of 1 byte char)
> string16 is UTF-16 string (array of 2 byte char)
> string32 is UTF-32 string (array of 4 byte char)
> or no?
> if so, I'm confused
> > +---+---+---+---+
> > | 3 | j | o | e |
> > +---+---+---+---+
> 
> 1 int8 is length = 3
> 3 int8 is string = "joe", it's ok, but
> 
> > +---+---+---+---+---+
> > | 0 | 3 | j | o | e |
> > +---+---+---+---+---+
> 
> what does this mean?
> 2 int16 for length = "03"
> 3 int16 for string = "joe", O_o
> or
> 1 int16 for length = 3
> 3 int8 for string = "joe", o_O?
> and Why be so hard?
> may UTF-8 best choice?
> 
> 2) Data types
> may "Scalar value types" from google protocol buffers is better choice
> for data types in verse 2?
> http://code.google.com/intl/ru-RU/apis/protocolbuffers/docs/proto.html#scalar
> http://code.google.com/intl/ru-RU/apis/protocolbuffers/docs/encoding.html#varints
> may take Google Protocol Buffer as a basis for the Verse protocol?
> and where signed integer types in specification?
> 
> Best Regards,
> Oleg aka cNoNim
> 
> PS: Sorry for my English
> _______________________________________________
> Verse-dev mailing list
> Verse-dev at blender.org
> http://lists.blender.org/mailman/listinfo/verse-dev




More information about the Verse-dev mailing list