| |
| /pliant/language/data/string_cast.pli |
| |
| 1 |
# Copyright Hubert Tonneau hubert.tonneau@pliant.cx | |
| 2 |
# | |
| 3 |
# This program is free software; you can redistribute it and/or | |
| 4 |
# modify it under the terms of the GNU General Public License version 2 | |
| 5 |
# as published by the Free Software Foundation. | |
| 6 |
# | |
| 7 |
# This program is distributed in the hope that it will be useful, | |
| 8 |
# but WITHOUT ANY WARRANTY; without even the implied warranty of | |
| 9 |
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
| 10 |
# GNU General Public License for more details. | |
| 11 |
# | |
| 12 |
# You should have received a copy of the GNU General Public License | |
| 13 |
# version 2 along with this program; if not, write to the Free Software | |
| 14 |
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. | |
| 15 |
| |
| 16 |
module "/pliant/install/ring2.pli" | |
| 17 |
| |
| 18 |
| |
| 19 |
constant from_index (the_function '. from string' Universal Str Str CBool Int Int -> Status):generic_index | |
| 20 |
| |
| 21 |
method data from_string_ string options may_skip skiped offset function -> status | |
| 22 |
arg_w Universal data ; arg Str string options ; arg CBool may_skip ; arg_w Int skiped offset ; arg Function function ; arg Status status | |
| 23 |
indirect | |
| 24 |
| |
| 25 |
function from_string adr type string options may_skip skiped offset -> status | |
| 26 |
arg Address adr ; arg Type type ; arg Str string options ; arg CBool may_skip ; arg_w Int skiped offset ; arg Status status | |
| 27 |
var Pointer:Function function :> type get_generic_method from_index | |
| 28 |
status := (adr map Universal) from_string_ string options may_skip skiped offset function | |
| 29 |
| |
| 30 |
function from_string adr type string options -> status | |
| 31 |
arg Address adr ; arg Type type ; arg Str string options ; arg Status status | |
| 32 |
status := from_string adr type string options false (var Int skiped) (var Int offset) | |
| 33 |
| |
| 34 |
| |
| 35 |
constant to_index (the_function '. to string' Universal Str -> Str):generic_index | |
| 36 |
| |
| 37 |
method data to_string_ options function -> string | |
| 38 |
arg_w Universal data ; arg Str options ; arg Function function ; arg Str string | |
| 39 |
indirect | |
| 40 |
| |
| 41 |
function to_string adr type options -> string | |
| 42 |
arg Address adr ; arg Type type ; arg Str options string | |
| 43 |
var Pointer:Function function :> type get_generic_method to_index | |
| 44 |
string := (adr map Universal) to_string_ options function | |
| 45 |
| |
| 46 |
| |
| 47 |
export from_string to_string | |
| |