Something like the following should work (warning, untested code):
    
    
    type
      Val* = object
        mvSize*: csize      #*< size of the data item
        mvData*: pointer    #*< address of the data item
    
    proc valToString*(v: Val): string =
      result = newString(v.mvSize)
      copyMem(addr result[0], v.mvData, v.mvSize)
    

Reply via email to