diff options
author | guy Decoux <ts@moulon.inra.fr> | 2009-02-28 20:18:11 +0100 |
---|---|---|
committer | guy Decoux <ts@moulon.inra.fr> | 2009-02-28 20:18:11 +0100 |
commit | 697ed85e893ab9039bf52a9bcd0ecadf1af9b654 (patch) | |
tree | afeb13f977c3db12607f87666b573d9bd3cb924f | |
parent | a5a5f38eb3086869144728ec7d978d448b2f98aa (diff) | |
download | mmap-ruby-697ed85e893ab9039bf52a9bcd0ecadf1af9b654.zip mmap-ruby-697ed85e893ab9039bf52a9bcd0ecadf1af9b654.tar.gz |
mmap-0.2.4
-rw-r--r-- | README.en | 1 | ||||
-rw-r--r-- | docs/mmap.rb | 396 | ||||
-rw-r--r-- | extconf.rb | 19 | ||||
-rw-r--r-- | mmap.c | 93 | ||||
-rw-r--r-- | mmap.html | 338 | ||||
-rw-r--r-- | mmap.rd | 8 |
6 files changed, 606 insertions, 249 deletions
@@ -11,6 +11,7 @@ make rd2 make rdoc + make ri See mmap.rd, mmap.html diff --git a/docs/mmap.rb b/docs/mmap.rb new file mode 100644 index 0000000..2c585a0 --- /dev/null +++ b/docs/mmap.rb @@ -0,0 +1,396 @@ +# The Mmap class implement memory-mapped file objects +# +# Most of these methods have the same syntax than the methods of String +# +# === WARNING +# === The variables $' and $` are not available with gsub! and sub! +class Mmap + include Comparable + include Enumerable + class << self + + #disable paging of all pages mapped. <em>flag</em> can be + #<em>Mmap::MCL_CURRENT</em> or <em>Mmap::MCL_FUTURE</em> + # + def lockall(flag) + end + + #create a new Mmap object + # + #* <em>file</em> + # + # Pathname of the file, if <em>nil</em> is given an anonymous map + # is created <em>Mmanp::MAP_ANON</em> + # + #* <em>mode</em> + # + # Mode to open the file, it can be "r", "w", "rw", "a" + # + #* <em>protection</em> + # + # specify the nature of the mapping + # + # * <em>Mmap::MAP_SHARED</em> + # + # Creates a mapping that's shared with all other processes + # mapping the same areas of the file. + # The default value is <em>Mmap::MAP_SHARED</em> + # + # * <em>Mmap::MAP_PRIVATE</em> + # + # Creates a private copy-on-write mapping, so changes to the + # contents of the mmap object will be private to this process + # + #* <em>options</em> + # + # Hash. If one of the options <em>length</em> or <em>offset</em> + # is specified it will not possible to modify the size of + # the mapped file. + # + # length:: maps <em>length</em> bytes from the file + # + # offset:: the mapping begin at <em>offset</em> + # + # advice:: the type of the access (see #madvise) + # + # + def new(file, mode = "r", protection = Mmap::MAP_SHARED, options = {}) + end + + #reenable paging + # + def unlockall + end + end + + #add <em>count</em> bytes to the file (i.e. pre-extend the file) + # + def extend(count) + end + + #<em>advice</em> can have the value <em>Mmap::MADV_NORMAL</em>, + #<em>Mmap::MADV_RANDOM</em>, <em>Mmap::MADV_SEQUENTIAL</em>, + #<em>Mmap::MADV_WILLNEED</em>, <em>Mmap::MADV_DONTNEED</em> + # + def madvise(advice) + end + + #change the mode, value must be "r", "w" or "rw" + # + def mprotect(mode) + end + + #disable paging + # + def mlock + end + + #flush the file + # + def msync + end + #same than <em> msync</em> + def flush + end + + #reenable paging + # + def munlock + end + + #terminate the association + def munmap + end + # + #=== Other methods with the same syntax than for the class String + # + # + + #comparison + # + def ==(other) + end + + #comparison + # + def >(other) + end + + #comparison + # + def >=(other) + end + + #comparison + # + def <(other) + end + + #comparison + # + def <=(other) + end + + #used for <em>case</em> comparison + # + def ===(other) + end + + #append <em>other</em> to <em>self</em> + # + def <<(other) + end + + #return an index of the match + # + def =~(other) + end + + #Element reference - with the following syntax + # + #self[nth] + # + #retrieve the <em>nth</em> character + # + #self[start..last] + # + #return a substring from <em>start</em> to <em>last</em> + # + #self[start, length] + # + #return a substring of <em>lenght</em> characters from <em>start</em> + # + def [](args) + end + + + # Element assignement - with the following syntax + # + # self[nth] = val + # + # change the <em>nth</em> character with <em>val</em> + # + # self[start..last] = val + # + # change substring from <em>start</em> to <em>last</em> with <em>val</em> + # + # self[start, len] = val + # + # replace <em>length</em> characters from <em>start</em> with <em>val</em>. + # + def []=(args) + end + + #comparison : return -1, 0, 1 + # + def self <=> other + end + + # only with ruby >= 1.7.1 + def casecmp(other) + end + + #append the contents of <em>other</em> + # + def concat(other) + end + + #change the first character to uppercase letter + # + def capitalize! + end + + #chop off the last character + # + def chop! + end + + #chop off the line ending character, specified by <em>rs</em> + # + def chomp!(rs = $/) + end + + #each parameter defines a set of character to count + # + def count(o1 [, o2, ...]) + end + + #crypt with <em>salt</em> + # + def crypt(salt) + end + + #delete every characters included in <em>str</em> + # + def delete!(str) + end + + #change all uppercase character to lowercase character + # + def downcase! + end + + #iterate on each byte + # + def each_byte + yield char + end + + #iterate on each line + # + def each(rs = $/) + yield line + end + #same than <em> each</em> + def each_line(rs = $/) + yield line + end + + #return <em>true</em> if the file is empty + # + def empty? + end + + #freeze the current file + # + def freeze + end + + #return <em>true</em> if the file is frozen + # + def frozen + end + + #global substitution + # + #str.gsub!(pattern, replacement) => str or nil + # + #str.gsub!(pattern) {|match| block } => str or nil + # + def gsub!(pattern, replacement = nil) + end + + #return <em>true</em> if <em>other</em> is found + # + def include?(other) + end + + #return the index of <em>substr</em> + # + def index(substr[, pos]) + end + + #insert <em>str</em> at <em>index</em> + # + def insert(index, str) >= 1.7.1 + end + + #return the size of the file + # + def length + end + + #convert <em>pattern</em> to a <em>Regexp</em> and then call + #<em>match</em> on <em>self</em> + def match(pattern) + end + + #reverse the content of the file + # + def reverse! + end + + #return the index of the last occurrence of <em>substr</em> + # + def rindex(substr[, pos]) + end + + #return an array of all occurence matched by <em>pattern</em> + # + def scan(pattern) + end + + #iterate through the file, matching the <em>pattern</em> + # + def scan(pattern) + yield str + end + + #return the size of the file + # + def size + end + + #same than <em>[]</em> + # + def slice + end + + #delete the specified portion of the file + # + def slice! + end + + #splits into a list of strings and return this array + # + def split([sep[, limit]]) + end + + #squeezes sequences of the same characters which is included in <em>str</em> + # + def squeeze!([str]) + end + + #removes leading and trailing whitespace + # + def strip! + end + + #removes leading whitespace + # + def lstrip! + end + + #removes trailing whitespace + # + def rstrip! + end + + #substitution + # + #str.sub!(pattern, replacement) => str or nil + # + #str.sub!(pattern) {|match| block } => str or nil + # + # + def sub!(pattern, replacement = nil) + end + + #return a checksum + # + def sum(bits = 16) + end + + #replaces all lowercase characters to uppercase characters, and vice-versa + # + def swapcase! + end + + #translate the character from <em>search</em> to <em>replace</em> + # + def tr!(search, replace) + end + + #translate the character from <em>search</em> to <em>replace</em>, then + #squeeze sequence of the same characters + # + def tr_s!(search, replace) + end + + #replaces all lowercase characters to downcase characters + # + def upcase! + end + + +end @@ -15,6 +15,12 @@ end dir_config("mmap") +["lstrip", "match", "insert", "casecmp"].each do |func| + if "aa".respond_to?(func) + $CFLAGS += " -DHAVE_RB_STR_#{func.upcase}" + end +end + create_makefile "mmap" begin @@ -30,7 +36,7 @@ begin unknown: $(DLLIB) \t@echo "main() {}" > /tmp/a.c -\t$(CC) -static /tmp/a.c $(OBJS) $(CPPFLAGS) $(LIBPATH) $(LIBS) $(LOCAL_LIBS) +\t$(CC) -static /tmp/a.c $(OBJS) $(CPPFLAGS) $(DLDFLAGS) $(LIBS) $(LOCAL_LIBS) \t@-rm /tmp/a.c a.out EOT @@ -43,15 +49,20 @@ EOT make.print "HTML = mmap.html" docs = Dir['docs/*.rd'] docs.each {|x| make.print " \\\n\t#{x.sub(/\.rd$/, '.html')}" } - make.print "\n\nRDOC = mmap.rd" - docs.each {|x| make.print " \\\n\t#{x}" } + make.print "\n\nRDOC = docs/mmap.rb" make.puts make.print <<-EOF rdoc: docs/doc/index.html docs/doc/index.html: $(RDOC) -\t@-(cd docs; $(RUBY) b.rb mmap; rdoc mmap.rb) +\t@-(cd docs; rdoc mmap.rb) + +ri: docs/mmap.rb +\t@-(cd docs; rdoc -r mmap.rb) + +ri-site: docs/mmap.rb +\t@-(cd docs; rdoc -R mmap.rb) rd2: html @@ -7,7 +7,6 @@ #include <sys/mman.h> #include <rubyio.h> #include <intern.h> -#include "version.h" #include <re.h> #ifndef StringValue @@ -160,7 +159,7 @@ mm_str(obj, modify) if (!OBJ_TAINTED(ret) && rb_safe_level() >= 4) rb_raise(rb_eSecurityError, "Insecure: can't modify mmap"); } -#if RUBY_VERSION_CODE >= 171 +#if HAVE_RB_DEFINE_ALLOC_FUNC ret = rb_obj_alloc(rb_cString); if (rb_obj_tainted(obj)) { OBJ_TAINT(ret); @@ -177,7 +176,7 @@ mm_str(obj, modify) RSTRING(ret)->ptr = t_mm->addr; RSTRING(ret)->len = t_mm->real; if (modify & MM_ORIGIN) { -#if RUBY_VERSION_CODE >= 172 +#if HAVE_RB_DEFINE_ALLOC_FUNC RSTRING(ret)->aux.shared = ret; FL_SET(ret, ELTS_SHARED); #else @@ -317,8 +316,16 @@ mm_i_options(arg, obj) return Qnil; } +static VALUE +mm_s_new(argc, argv, obj) + int argc; + VALUE *argv, obj; +{ + VALUE res = rb_funcall2(obj, rb_intern("allocate"), 0, 0); + rb_obj_call_init(res, argc, argv); + return res; +} -#if RUBY_VERSION_CODE >= 172 static VALUE mm_s_alloc(obj) VALUE obj; @@ -330,21 +337,16 @@ mm_s_alloc(obj) t_mm->incr = EXP_INCR_SIZE; return res; } -#endif static VALUE -#if RUBY_VERSION_CODE >= 172 mm_init(argc, argv, obj) -#else -mm_s_new(argc, argv, obj) -#endif VALUE obj, *argv; int argc; { struct stat st; int fd, smode = 0, pmode = 0, vscope, perm, init; MMAP_RETTYPE addr; - VALUE res, fname, fdv, vmode, scope, options; + VALUE fname, fdv, vmode, scope, options; mm_mmap *t_mm; char *path, *mode; size_t size = 0; @@ -450,16 +452,10 @@ mm_s_new(argc, argv, obj) size = NUM2INT(vmode); } } -#if RUBY_VERSION_CODE >= 172 Data_Get_Struct(obj, mm_mmap, t_mm); - res = obj; -#else - res = Data_Make_Struct(obj, mm_mmap, 0, mm_free, t_mm); - t_mm->incr = EXP_INCR_SIZE; -#endif offset = 0; if (options != Qnil) { - rb_iterate(rb_each, options, mm_i_options, res); + rb_iterate(rb_each, options, mm_i_options, obj); if (path && (t_mm->len + t_mm->offset) > st.st_size) { rb_raise(rb_eArgError, "invalid value for length (%d) or offset (%d)", t_mm->len, t_mm->offset); @@ -525,31 +521,17 @@ mm_s_new(argc, argv, obj) t_mm->smode = smode; t_mm->path = (path)?ruby_strdup(path):(char *)-1; if (smode == O_RDONLY) { - res = rb_obj_freeze(res); + obj = rb_obj_freeze(obj); t_mm->flag |= MM_FROZEN; } else { if (smode == O_WRONLY) { t_mm->flag |= MM_FIXED; } - OBJ_TAINT(res); + OBJ_TAINT(obj); } -#if RUBY_VERSION_CODE < 172 - rb_obj_call_init(res, argc, argv); -#endif - return res; -} - -#if RUBY_VERSION_CODE < 171 -static VALUE -mm_init(argc, argv, obj) - int argc; - VALUE *argv, obj; -{ return obj; } -#endif - static VALUE mm_msync(argc, argv, obj) @@ -915,7 +897,7 @@ mm_gsub_bang(argc, argv, obj) static VALUE mm_index __((int, VALUE *, VALUE)); -#if RUBY_VERSION_CODE >= 171 +#if HAVE_RB_DEFINE_ALLOC_FUNC static void mm_subpat_set(obj, re, offset, val) @@ -980,7 +962,7 @@ mm_aset(str, indx, val) return val; case T_REGEXP: -#if RUBY_VERSION_CODE >= 171 +#if HAVE_RB_DEFINE_ALLOC_FUNC mm_subpat_set(str, indx, 0, val); #else { @@ -1029,7 +1011,7 @@ mm_aset_m(argc, argv, str) if (argc == 3) { long beg, len; -#if RUBY_VERSION_CODE >= 171 +#if HAVE_RB_DEFINE_ALLOC_FUNC if (TYPE(argv[0]) == T_REGEXP) { mm_subpat_set(str, argv[0], NUM2INT(argv[1]), argv[2]); } @@ -1048,7 +1030,7 @@ mm_aset_m(argc, argv, str) return mm_aset(str, argv[0], argv[1]); } -#if RUBY_VERSION_CODE >= 171 +#if HAVE_RB_STR_INSERT static VALUE mm_insert(str, idx, str2) @@ -1090,13 +1072,9 @@ mm_slice_bang(argc, argv, str) } buf[i] = rb_str_new(0,0); result = mm_aref_m(argc, buf, str); -#if RUBY_VERSION_CODE >= 168 if (!NIL_P(result)) { -#endif mm_aset_m(argc+1, buf, str); -#if RUBY_VERSION_CODE >= 168 } -#endif return result; } @@ -1153,7 +1131,7 @@ mm_concat(str1, str2) return str1; } -#if RUBY_VERSION_CODE < 171 +#ifndef HAVE_RB_STR_LSTRIP static VALUE mm_strip_bang(str) @@ -1171,18 +1149,18 @@ mm_strip_bang(str) t++; if (t_mm->real != (t - s) && (t_mm->flag & MM_FIXED)) { - rb_raise(rb_eTypeError, "try to change the size of a fixed map"); + rb_raise(rb_eTypeError, "try to change the size of a fixed map"); } t_mm->real = t-s; if (s > (char *)t_mm->addr) { - memmove(t_mm->addr, s, t_mm->real); - ((char *)t_mm->addr)[t_mm->real] = '\0'; + memmove(t_mm->addr, s, t_mm->real); + ((char *)t_mm->addr)[t_mm->real] = '\0'; } else if (t < e) { - ((char *)t_mm->addr)[t_mm->real] = '\0'; + ((char *)t_mm->addr)[t_mm->real] = '\0'; } else { - return Qnil; + return Qnil; } return str; @@ -1279,7 +1257,7 @@ mm_cmp(a, b) return INT2FIX(result); } -#if RUBY_VERSION_CODE >= 171 +#if HAVE_RB_STR_CASECMP static VALUE mm_casecmp(a, b) @@ -1415,7 +1393,7 @@ mm_bang_i(obj, flag, id, argc, argv) } -#if RUBY_VERSION_CODE >= 180 +#if HAVE_RB_STR_MATCH static VALUE mm_match_m(a, b) @@ -1750,15 +1728,12 @@ Init_mmap() rb_include_module(mm_cMap, rb_mComparable); rb_include_module(mm_cMap, rb_mEnumerable); -#if RUBY_VERSION_CODE >= 172 -#if RUBY_VERSION_CODE >= 180 +#if HAVE_RB_DEFINE_ALLOC_FUNC rb_define_alloc_func(mm_cMap, mm_s_alloc); #else rb_define_singleton_method(mm_cMap, "allocate", mm_s_alloc, 0); #endif -#else rb_define_singleton_method(mm_cMap, "new", mm_s_new, -1); -#endif rb_define_singleton_method(mm_cMap, "mlockall", mm_mlockall, 1); rb_define_singleton_method(mm_cMap, "lockall", mm_mlockall, 1); rb_define_singleton_method(mm_cMap, "munlockall", mm_munlockall, 0); @@ -1785,16 +1760,14 @@ Init_mmap() rb_define_method(mm_cMap, "extend", mm_extend, 1); rb_define_method(mm_cMap, "freeze", mm_freeze, 0); rb_define_method(mm_cMap, "clone", mm_undefined, -1); -#if RUBY_VERSION_CODE >= 180 rb_define_method(mm_cMap, "initialize_copy", mm_undefined, -1); -#endif rb_define_method(mm_cMap, "dup", mm_undefined, -1); rb_define_method(mm_cMap, "<=>", mm_cmp, 1); rb_define_method(mm_cMap, "==", mm_equal, 1); rb_define_method(mm_cMap, "===", mm_equal, 1); rb_define_method(mm_cMap, "eql?", mm_eql, 1); rb_define_method(mm_cMap, "hash", mm_hash, 0); -#if RUBY_VERSION_CODE >= 171 +#if HAVE_RB_STR_CASECMP rb_define_method(mm_cMap, "casecmp", mm_casecmp, 1); #endif rb_define_method(mm_cMap, "+", mm_undefined, -1); @@ -1802,7 +1775,7 @@ Init_mmap() rb_define_method(mm_cMap, "%", mm_undefined, -1); rb_define_method(mm_cMap, "[]", mm_aref_m, -1); rb_define_method(mm_cMap, "[]=", mm_aset_m, -1); -#if RUBY_VERSION_CODE >= 171 +#if HAVE_RB_STR_INSERT rb_define_method(mm_cMap, "insert", mm_insert, 2); #endif rb_define_method(mm_cMap, "length", mm_size, 0); @@ -1810,7 +1783,7 @@ Init_mmap() rb_define_method(mm_cMap, "empty?", mm_empty, 0); rb_define_method(mm_cMap, "=~", mm_match, 1); rb_define_method(mm_cMap, "~", mm_undefined, -1); -#if RUBY_VERSION_CODE >= 180 +#if HAVE_RB_STR_MATCH rb_define_method(mm_cMap, "match", mm_match_m, 1); #endif rb_define_method(mm_cMap, "succ", mm_undefined, -1); @@ -1863,7 +1836,7 @@ Init_mmap() rb_define_method(mm_cMap, "chop", mm_undefined, -1); rb_define_method(mm_cMap, "chomp", mm_undefined, -1); rb_define_method(mm_cMap, "strip", mm_undefined, -1); -#if RUBY_VERSION_CODE >= 171 +#if HAVE_RB_STR_LSTRIP rb_define_method(mm_cMap, "lstrip", mm_undefined, -1); rb_define_method(mm_cMap, "rstrip", mm_undefined, -1); #endif @@ -1871,7 +1844,7 @@ Init_mmap() rb_define_method(mm_cMap, "sub!", mm_sub_bang, -1); rb_define_method(mm_cMap, "gsub!", mm_gsub_bang, -1); rb_define_method(mm_cMap, "strip!", mm_strip_bang, 0); -#if RUBY_VERSION_CODE >= 171 +#if HAVE_RB_STR_LSTRIP rb_define_method(mm_cMap, "lstrip!", mm_lstrip_bang, 0); rb_define_method(mm_cMap, "rstrip!", mm_rstrip_bang, 0); #endif @@ -4,286 +4,268 @@ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> -<title>mmap.rd</title> +<title>Untitled</title> </head> <body> -<h1><a name="label:0" id="label:0">Mmap</a></h1><!-- RDLabel: "Mmap" --> +<h1><a name="label-0" id="label-0">Mmap</a></h1><!-- RDLabel: "Mmap" --> <p><a href="ftp://moulon.inra.fr/pub/ruby/">Download</a></p> <p>The Mmap class implement memory-mapped file objects</p> -<h3><a name="label:1" id="label:1">WARNING</a></h3><!-- RDLabel: "WARNING" --> -<h3><a name="label:2" id="label:2">The variables $' and $` are not available with gsub! and sub!</a></h3><!-- RDLabel: "The variables $' and $` are not available with gsub! and sub!" --> -<h2><a name="label:3" id="label:3">SuperClass</a></h2><!-- RDLabel: "SuperClass" --> +<h3><a name="label-1" id="label-1">WARNING</a></h3><!-- RDLabel: "WARNING" --> +<h3><a name="label-2" id="label-2">The variables $' and $` are not available with gsub! and sub!</a></h3><!-- RDLabel: "The variables $' and $` are not available with gsub! and sub!" --> +<h2><a name="label-3" id="label-3">SuperClass</a></h2><!-- RDLabel: "SuperClass" --> <p>Object</p> -<h2><a name="label:4" id="label:4">Included Modules</a></h2><!-- RDLabel: "Included Modules" --> +<h2><a name="label-4" id="label-4">Included Modules</a></h2><!-- RDLabel: "Included Modules" --> <ul> <li>Comparable</li> <li>Enumerable</li> </ul> -<h2><a name="label:5" id="label:5">Class Methods</a></h2><!-- RDLabel: "Class Methods" --> +<h2><a name="label-5" id="label-5">Class Methods</a></h2><!-- RDLabel: "Class Methods" --> <dl> -<dt><a name="label:6" id="label:6"><code>lockall(<var>flag</var>)</code></a></dt><!-- RDLabel: "lockall" --> +<dt><a name="label-6" id="label-6"><code>lockall(<var>flag</var>)</code></a></dt><!-- RDLabel: "lockall" --> <dd> -<p>disable paging of all pages mapped. <var>flag</var> can be -<var>Mmap::MCL_CURRENT</var> or <var>Mmap::MCL_FUTURE</var></p></dd> -<dt><a name="label:7" id="label:7"><code>new(<var>file</var>, <var>mode</var> = "<var>r</var>", <var>protection</var> = <var>Mmap</var>::<var>MAP_SHARED</var>, <var>options</var> = {})</code></a><!-- RDLabel: "new" --> -<dt><a name="label:8" id="label:8"><code>new(<var>nil</var>, <var>length</var>, <var>protection</var> = <var>Mmap</var>::<var>MAP_SHARED</var>, <var>options</var> = {})</code></a></dt><!-- RDLabel: "new" --> +disable paging of all pages mapped. <var>flag</var> can be +<var>Mmap::MCL_CURRENT</var> or <var>Mmap::MCL_FUTURE</var></dd> +<dt><a name="label-7" id="label-7"><code>new(<var>file</var>, <var>mode</var> = "<var>r</var>", <var>protection</var> = <var>Mmap</var>::<var>MAP_SHARED</var>, <var>options</var> = {})</code></a></dt><!-- RDLabel: "new" --> +<dt><a name="label-8" id="label-8"><code>new(<var>nil</var>, <var>length</var>, <var>protection</var> = <var>Mmap</var>::<var>MAP_SHARED</var>, <var>options</var> = {})</code></a></dt><!-- RDLabel: "new" --> <dd> -<p>create a new Mmap object</p> +create a new Mmap object <dl> -<dt><a name="label:9" id="label:9"><var>file</var> -</a></dt><!-- RDLabel: "file -" --> +<dt><a name="label-9" id="label-9"><var>file</var></a></dt><!-- RDLabel: "file" --> <dd> -<p>Pathname of the file, if <var>nil</var> is given an anonymous map -is created <var>Mmanp::MAP_ANON</var></p> +Pathname of the file, if <var>nil</var> is given an anonymous map +is created <var>Mmanp::MAP_ANON</var> </dd> -<dt><a name="label:10" id="label:10"><var>mode</var> -</a></dt><!-- RDLabel: "mode -" --> +<dt><a name="label-10" id="label-10"><var>mode</var></a></dt><!-- RDLabel: "mode" --> <dd> -<p>Mode to open the file, it can be "r", "w", "rw", "a"</p> +Mode to open the file, it can be "r", "w", "rw", "a" </dd> -<dt><a name="label:11" id="label:11"><var>protection</var> -</a></dt><!-- RDLabel: "protection -" --> +<dt><a name="label-11" id="label-11"><var>protection</var></a></dt><!-- RDLabel: "protection" --> <dd> -<p>specify the nature of the mapping</p> +specify the nature of the mapping <dl> -<dt><a name="label:12" id="label:12"><var>Mmap::MAP_SHARED</var> -</a></dt><!-- RDLabel: "Mmap::MAP_SHARED -" --> +<dt><a name="label-12" id="label-12"><var>Mmap::MAP_SHARED</var></a></dt><!-- RDLabel: "Mmap::MAP_SHARED" --> <dd> -<p>Creates a mapping that's shared with all other processes +Creates a mapping that's shared with all other processes mapping the same areas of the file. -The default value is <var>Mmap::MAP_SHARED</var></p> +The default value is <var>Mmap::MAP_SHARED</var> </dd> -<dt><a name="label:13" id="label:13"><var>Mmap::MAP_PRIVATE</var> -</a></dt><!-- RDLabel: "Mmap::MAP_PRIVATE -" --> +<dt><a name="label-13" id="label-13"><var>Mmap::MAP_PRIVATE</var></a></dt><!-- RDLabel: "Mmap::MAP_PRIVATE" --> <dd> -<p>Creates a private copy-on-write mapping, so changes to the -contents of the mmap object will be private to this process</p> +Creates a private copy-on-write mapping, so changes to the +contents of the mmap object will be private to this process </dd> </dl> </dd> -<dt><a name="label:14" id="label:14"><var>options</var> -</a></dt><!-- RDLabel: "options -" --> +<dt><a name="label-14" id="label-14"><var>options</var></a></dt><!-- RDLabel: "options" --> <dd> -<p>Hash. If one of the options <var>length</var> or <var>offset</var> +Hash. If one of the options <var>length</var> or <var>offset</var> is specified it will not possible to modify the size of -the mapped file.</p> +the mapped file. <dl> -<dt><a name="label:15" id="label:15"><var>length</var> -</a></dt><!-- RDLabel: "length -" --> +<dt><a name="label-15" id="label-15"><var>length</var></a></dt><!-- RDLabel: "length" --> <dd> -<p>Maps <var>length</var> bytes from the file</p> +Maps <var>length</var> bytes from the file </dd> -<dt><a name="label:16" id="label:16"><var>offset</var> -</a></dt><!-- RDLabel: "offset -" --> +<dt><a name="label-16" id="label-16"><var>offset</var></a></dt><!-- RDLabel: "offset" --> <dd> -<p>The mapping begin at <var>offset</var></p> +The mapping begin at <var>offset</var> </dd> -<dt><a name="label:17" id="label:17"><var>advice</var> -</a></dt><!-- RDLabel: "advice -" --> +<dt><a name="label-17" id="label-17"><var>advice</var></a></dt><!-- RDLabel: "advice" --> <dd> -<p>The type of the access (see #madvise)</p> +The type of the access (see #madvise) </dd> </dl> </dd> </dl></dd> -<dt><a name="label:18" id="label:18"><code>unlockall</code></a></dt><!-- RDLabel: "unlockall" --> +<dt><a name="label-18" id="label-18"><code>unlockall</code></a></dt><!-- RDLabel: "unlockall" --> <dd> -<p>reenable paging</p></dd> +reenable paging</dd> </dl> -<h2><a name="label:19" id="label:19">Methods</a></h2><!-- RDLabel: "Methods" --> +<h2><a name="label-19" id="label-19">Methods</a></h2><!-- RDLabel: "Methods" --> <dl> -<dt><a name="label:20" id="label:20"><code>extend(<var>count</var>)</code></a></dt><!-- RDLabel: "extend" --> +<dt><a name="label-20" id="label-20"><code>extend(<var>count</var>)</code></a></dt><!-- RDLabel: "extend" --> <dd> -<p>add <var>count</var> bytes to the file (i.e. pre-extend the file) </p></dd> -<dt><a name="label:21" id="label:21"><code>madvise(<var>advice</var>)</code></a></dt><!-- RDLabel: "madvise" --> +add <var>count</var> bytes to the file (i.e. pre-extend the file) </dd> +<dt><a name="label-21" id="label-21"><code>madvise(<var>advice</var>)</code></a></dt><!-- RDLabel: "madvise" --> <dd> -<p><var>advice</var> can have the value <var>Mmap::MADV_NORMAL</var>, +<var>advice</var> can have the value <var>Mmap::MADV_NORMAL</var>, <var>Mmap::MADV_RANDOM</var>, <var>Mmap::MADV_SEQUENTIAL</var>, -<var>Mmap::MADV_WILLNEED</var>, <var>Mmap::MADV_DONTNEED</var></p></dd> -<dt><a name="label:22" id="label:22"><code>mprotect(<var>mode</var>)</code></a></dt><!-- RDLabel: "mprotect" --> +<var>Mmap::MADV_WILLNEED</var>, <var>Mmap::MADV_DONTNEED</var></dd> +<dt><a name="label-22" id="label-22"><code>mprotect(<var>mode</var>)</code></a></dt><!-- RDLabel: "mprotect" --> <dd> -<p>change the mode, value must be "r", "w" or "rw"</p></dd> -<dt><a name="label:23" id="label:23"><code>mlock</code></a></dt><!-- RDLabel: "mlock" --> +change the mode, value must be "r", "w" or "rw"</dd> +<dt><a name="label-23" id="label-23"><code>mlock</code></a></dt><!-- RDLabel: "mlock" --> <dd> -<p>disable paging</p></dd> -<dt><a name="label:24" id="label:24"><code>msync</code></a><!-- RDLabel: "msync" --> -<dt><a name="label:25" id="label:25"><code>flush</code></a></dt><!-- RDLabel: "flush" --> +disable paging</dd> +<dt><a name="label-24" id="label-24"><code>msync</code></a></dt><!-- RDLabel: "msync" --> +<dt><a name="label-25" id="label-25"><code>flush</code></a></dt><!-- RDLabel: "flush" --> <dd> -<p>flush the file</p></dd> -<dt><a name="label:26" id="label:26"><code>munlock</code></a></dt><!-- RDLabel: "munlock" --> +flush the file</dd> +<dt><a name="label-26" id="label-26"><code>munlock</code></a></dt><!-- RDLabel: "munlock" --> <dd> -<p>reenable paging</p></dd> -<dt><a name="label:27" id="label:27"><code>munmap</code></a></dt><!-- RDLabel: "munmap" --> +reenable paging</dd> +<dt><a name="label-27" id="label-27"><code>munmap</code></a></dt><!-- RDLabel: "munmap" --> <dd> -<p>terminate the association</p></dd> +terminate the association</dd> </dl> -<h3><a name="label:28" id="label:28">Other methods with the same syntax than for the class String</a></h3><!-- RDLabel: "Other methods with the same syntax than for the class String" --> +<h3><a name="label-28" id="label-28">Other methods with the same syntax than for the class String</a></h3><!-- RDLabel: "Other methods with the same syntax than for the class String" --> <dl> -<dt><a name="label:29" id="label:29"><code><var>self</var> == <var>other</var></code></a></dt><!-- RDLabel: "self == other" --> +<dt><a name="label-29" id="label-29"><code><var>self</var> == <var>other</var></code></a></dt><!-- RDLabel: "self == other" --> <dd> -<p>comparison</p></dd> -<dt><a name="label:30" id="label:30"><code><var>self</var> > <var>other</var></code></a></dt><!-- RDLabel: "self > other" --> +comparison</dd> +<dt><a name="label-30" id="label-30"><code><var>self</var> > <var>other</var></code></a></dt><!-- RDLabel: "self > other" --> <dd> -<p>comparison</p></dd> -<dt><a name="label:31" id="label:31"><code><var>self</var> >= <var>other</var></code></a></dt><!-- RDLabel: "self >= other" --> +comparison</dd> +<dt><a name="label-31" id="label-31"><code><var>self</var> >= <var>other</var></code></a></dt><!-- RDLabel: "self >= other" --> <dd> -<p>comparison</p></dd> -<dt><a name="label:32" id="label:32"><code><var>self</var> < <var>other</var></code></a></dt><!-- RDLabel: "self < other" --> +comparison</dd> +<dt><a name="label-32" id="label-32"><code><var>self</var> < <var>other</var></code></a></dt><!-- RDLabel: "self < other" --> <dd> -<p>comparison</p></dd> -<dt><a name="label:33" id="label:33"><code><var>self</var> <= <var>other</var></code></a></dt><!-- RDLabel: "self <= other" --> +comparison</dd> +<dt><a name="label-33" id="label-33"><code><var>self</var> <= <var>other</var></code></a></dt><!-- RDLabel: "self <= other" --> <dd> -<p>comparison</p></dd> -<dt><a name="label:34" id="label:34"><code><var>self</var> === <var>other</var></code></a></dt><!-- RDLabel: "self === other" --> +comparison</dd> +<dt><a name="label-34" id="label-34"><code><var>self</var> === <var>other</var></code></a></dt><!-- RDLabel: "self === other" --> <dd> -<p>used for <var>case</var> comparison</p></dd> -<dt><a name="label:35" id="label:35"><code><var>self</var> << <var>other</var></code></a></dt><!-- RDLabel: "self << other" --> +used for <var>case</var> comparison</dd> +<dt><a name="label-35" id="label-35"><code><var>self</var> << <var>other</var></code></a></dt><!-- RDLabel: "self << other" --> <dd> -<p>append <var>other</var> to <var>self</var></p></dd> -<dt><a name="label:36" id="label:36"><code><var>self</var> =~ <var>other</var></code></a></dt><!-- RDLabel: "self =~ other" --> +append <var>other</var> to <var>self</var></dd> +<dt><a name="label-36" id="label-36"><code><var>self</var> =~ <var>other</var></code></a></dt><!-- RDLabel: "self =~ other" --> <dd> -<p>return an index of the match </p></dd> -<dt><a name="label:37" id="label:37"><code>self[nth]</code></a></dt><!-- RDLabel: "self[nth]" --> +return an index of the match </dd> +<dt><a name="label-37" id="label-37"><code>self[nth]</code></a></dt><!-- RDLabel: "self[nth]" --> <dd> -<p>retrieve the <var>nth</var> character</p></dd> -<dt><a name="label:38" id="label:38"><code>self[start..last]</code></a></dt><!-- RDLabel: "self[start..last]" --> +retrieve the <var>nth</var> character</dd> +<dt><a name="label-38" id="label-38"><code>self[start..last]</code></a></dt><!-- RDLabel: "self[start..last]" --> <dd> -<p>return a substring from <var>start</var> to <var>last</var></p></dd> -<dt><a name="label:39" id="label:39"><code>self[start, <var>length</var>]</code></a></dt><!-- RDLabel: "self[start, length]" --> +return a substring from <var>start</var> to <var>last</var></dd> +<dt><a name="label-39" id="label-39"><code>self[start, <var>length</var>]</code></a></dt><!-- RDLabel: "self[start, length]" --> <dd> -<p>return a substring of <var>lenght</var> characters from <var>start</var> </p></dd> -<dt><a name="label:40" id="label:40"><code>self[nth] = <var>val</var></code></a></dt><!-- RDLabel: "self[nth] = val" --> +return a substring of <var>lenght</var> characters from <var>start</var> </dd> +<dt><a name="label-40" id="label-40"><code>self[nth] = <var>val</var></code></a></dt><!-- RDLabel: "self[nth] = val" --> <dd> -<p>change the <var>nth</var> character with <var>val</var></p></dd> -<dt><a name="label:41" id="label:41"><code>self[start..last] = <var>val</var></code></a></dt><!-- RDLabel: "self[start..last] = val" --> +change the <var>nth</var> character with <var>val</var></dd> +<dt><a name="label-41" id="label-41"><code>self[start..last] = <var>val</var></code></a></dt><!-- RDLabel: "self[start..last] = val" --> <dd> -<p>change substring from <var>start</var> to <var>last</var> with <var>val</var></p></dd> -<dt><a name="label:42" id="label:42"><code>self[start, <var>len</var>] = <var>val</var></code></a></dt><!-- RDLabel: "self[start, len] = val" --> +change substring from <var>start</var> to <var>last</var> with <var>val</var></dd> +<dt><a name="label-42" id="label-42"><code>self[start, <var>len</var>] = <var>val</var></code></a></dt><!-- RDLabel: "self[start, len] = val" --> <dd> -<p>replace <var>length</var> characters from <var>start</var> with <var>val</var>.</p></dd> -<dt><a name="label:43" id="label:43"><code><var>self</var> <=> <var>other</var></code></a></dt><!-- RDLabel: "self <=> other" --> +replace <var>length</var> characters from <var>start</var> with <var>val</var>.</dd> +<dt><a name="label-43" id="label-43"><code><var>self</var> <=> <var>other</var></code></a></dt><!-- RDLabel: "self <=> other" --> <dd> -<p>comparison : return -1, 0, 1</p></dd> -<dt><a name="label:44" id="label:44"><code>casecmp(<var>other</var>) >= <var>1</var>.<var>7</var>.<var>1</var></code></a><!-- RDLabel: "casecmp" --> -<dt><a name="label:45" id="label:45"><code>concat(<var>other</var>)</code></a></dt><!-- RDLabel: "concat" --> +comparison : return -1, 0, 1</dd> +<dt><a name="label-44" id="label-44"><code>casecmp(<var>other</var>) >= <var>1</var>.<var>7</var>.<var>1</var></code></a></dt><!-- RDLabel: "casecmp" --> +<dt><a name="label-45" id="label-45"><code>concat(<var>other</var>)</code></a></dt><!-- RDLabel: "concat" --> <dd> -<p>append the contents of <var>other</var></p></dd> -<dt><a name="label:46" id="label:46"><code>capitalize!</code></a></dt><!-- RDLabel: "capitalize!" --> +append the contents of <var>other</var></dd> +<dt><a name="label-46" id="label-46"><code>capitalize!</code></a></dt><!-- RDLabel: "capitalize!" --> <dd> -<p>change the first character to uppercase letter</p></dd> -<dt><a name="label:47" id="label:47"><code>chop!</code></a></dt><!-- RDLabel: "chop!" --> +change the first character to uppercase letter</dd> +<dt><a name="label-47" id="label-47"><code>chop!</code></a></dt><!-- RDLabel: "chop!" --> <dd> -<p>chop off the last character</p></dd> -<dt><a name="label:48" id="label:48"><code>chomp!([<var>rs</var>])</code></a></dt><!-- RDLabel: "chomp!" --> +chop off the last character</dd> +<dt><a name="label-48" id="label-48"><code>chomp!([<var>rs</var>])</code></a></dt><!-- RDLabel: "chomp!" --> <dd> -<p>chop off the line ending character, specified by <var>rs</var></p></dd> -<dt><a name="label:49" id="label:49"><code>count(<var>o1</var> [, <var>o2</var>, ...])</code></a></dt><!-- RDLabel: "count" --> +chop off the line ending character, specified by <var>rs</var></dd> +<dt><a name="label-49" id="label-49"><code>count(<var>o1</var> [, <var>o2</var>, ...])</code></a></dt><!-- RDLabel: "count" --> <dd> -<p>each parameter defines a set of character to count</p></dd> -<dt><a name="label:50" id="label:50"><code>crypt(<var>salt</var>)</code></a></dt><!-- RDLabel: "crypt" --> +each parameter defines a set of character to count</dd> +<dt><a name="label-50" id="label-50"><code>crypt(<var>salt</var>)</code></a></dt><!-- RDLabel: "crypt" --> <dd> -<p>crypt with <var>salt</var> </p></dd> -<dt><a name="label:51" id="label:51"><code>delete!(<var>str</var>)</code></a></dt><!-- RDLabel: "delete!" --> +crypt with <var>salt</var> </dd> +<dt><a name="label-51" id="label-51"><code>delete!(<var>str</var>)</code></a></dt><!-- RDLabel: "delete!" --> <dd> -<p>delete every characters included in <var>str</var></p></dd> -<dt><a name="label:52" id="label:52"><code>downcase!</code></a></dt><!-- RDLabel: "downcase!" --> +delete every characters included in <var>str</var></dd> +<dt><a name="label-52" id="label-52"><code>downcase!</code></a></dt><!-- RDLabel: "downcase!" --> <dd> -<p>change all uppercase character to lowercase character</p></dd> -<dt><a name="label:53" id="label:53"><code>each_byte {|<var>char</var>|...}</code></a></dt><!-- RDLabel: "each_byte" --> +change all uppercase character to lowercase character</dd> +<dt><a name="label-53" id="label-53"><code>each_byte {|<var>char</var>|...}</code></a></dt><!-- RDLabel: "each_byte" --> <dd> -<p>iterate on each byte</p></dd> -<dt><a name="label:54" id="label:54"><code>each([<var>rs</var>]) {|<var>line</var>|...}</code></a><!-- RDLabel: "each" --> -<dt><a name="label:55" id="label:55"><code>each_line([<var>rs</var>]) {|<var>line</var>|...}</code></a></dt><!-- RDLabel: "each_line" --> +iterate on each byte</dd> +<dt><a name="label-54" id="label-54"><code>each([<var>rs</var>]) {|<var>line</var>|...}</code></a></dt><!-- RDLabel: "each" --> +<dt><a name="label-55" id="label-55"><code>each_line([<var>rs</var>]) {|<var>line</var>|...}</code></a></dt><!-- RDLabel: "each_line" --> <dd> -<p>iterate on each line</p></dd> -<dt><a name="label:56" id="label:56"><code>empty?</code></a></dt><!-- RDLabel: "empty?" --> +iterate on each line</dd> +<dt><a name="label-56" id="label-56"><code>empty?</code></a></dt><!-- RDLabel: "empty?" --> <dd> -<p>return <var>true</var> if the file is empty</p></dd> -<dt><a name="label:57" id="label:57"><code>freeze</code></a></dt><!-- RDLabel: "freeze" --> +return <var>true</var> if the file is empty</dd> +<dt><a name="label-57" id="label-57"><code>freeze</code></a></dt><!-- RDLabel: "freeze" --> <dd> -<p>freeze the current file </p></dd> -<dt><a name="label:58" id="label:58"><code>frozen</code></a></dt><!-- RDLabel: "frozen" --> +freeze the current file </dd> +<dt><a name="label-58" id="label-58"><code>frozen</code></a></dt><!-- RDLabel: "frozen" --> <dd> -<p>return <var>true</var> if the file is frozen</p></dd> -<dt><a name="label:59" id="label:59"><code>gsub!(<var>pattern</var>, <var>replace</var>)</code></a></dt><!-- RDLabel: "gsub!" --> +return <var>true</var> if the file is frozen</dd> +<dt><a name="label-59" id="label-59"><code>gsub!(<var>pattern</var>, <var>replace</var>)</code></a></dt><!-- RDLabel: "gsub!" --> <dd> -<p>global substitution</p></dd> -<dt><a name="label:60" id="label:60"><code>gsub!(<var>pattern</var>) {|<var>str</var>|...}</code></a></dt><!-- RDLabel: "gsub!" --> +global substitution</dd> +<dt><a name="label-60" id="label-60"><code>gsub!(<var>pattern</var>) {|<var>str</var>|...}</code></a></dt><!-- RDLabel: "gsub!" --> <dd> -<p>global substitution</p></dd> -<dt><a name="label:61" id="label:61"><code>include?(<var>other</var>)</code></a></dt><!-- RDLabel: "include?" --> +global substitution</dd> +<dt><a name="label-61" id="label-61"><code>include?(<var>other</var>)</code></a></dt><!-- RDLabel: "include?" --> <dd> -<p>return <var>true</var> if <var>other</var> is found</p></dd> -<dt><a name="label:62" id="label:62"><code>index(<var>substr</var>[, <var>pos</var>])</code></a></dt><!-- RDLabel: "index" --> +return <var>true</var> if <var>other</var> is found</dd> +<dt><a name="label-62" id="label-62"><code>index(<var>substr</var>[, <var>pos</var>])</code></a></dt><!-- RDLabel: "index" --> <dd> -<p>return the index of <var>substr</var> </p></dd> -<dt><a name="label:63" id="label:63"><code>insert(<var>index</var>, <var>str</var>) >= <var>1</var>.<var>7</var>.<var>1</var></code></a></dt><!-- RDLabel: "insert" --> +return the index of <var>substr</var> </dd> +<dt><a name="label-63" id="label-63"><code>insert(<var>index</var>, <var>str</var>) >= <var>1</var>.<var>7</var>.<var>1</var></code></a></dt><!-- RDLabel: "insert" --> <dd> -<p>insert <var>str</var> at <var>index</var></p></dd> -<dt><a name="label:64" id="label:64"><code>length</code></a></dt><!-- RDLabel: "length" --> +insert <var>str</var> at <var>index</var></dd> +<dt><a name="label-64" id="label-64"><code>length</code></a></dt><!-- RDLabel: "length" --> <dd> -<p>return the size of the file</p></dd> -<dt><a name="label:65" id="label:65"><code>reverse!</code></a></dt><!-- RDLabel: "reverse!" --> +return the size of the file</dd> +<dt><a name="label-65" id="label-65"><code>reverse!</code></a></dt><!-- RDLabel: "reverse!" --> <dd> -<p>reverse the content of the file </p></dd> -<dt><a name="label:66" id="label:66"><code>rindex(<var>substr</var>[, <var>pos</var>])</code></a></dt><!-- RDLabel: "rindex" --> +reverse the content of the file </dd> +<dt><a name="label-66" id="label-66"><code>rindex(<var>substr</var>[, <var>pos</var>])</code></a></dt><!-- RDLabel: "rindex" --> <dd> -<p>return the index of the last occurrence of <var>substr</var></p></dd> -<dt><a name="label:67" id="label:67"><code>scan(<var>pattern</var>)</code></a></dt><!-- RDLabel: "scan" --> +return the index of the last occurrence of <var>substr</var></dd> +<dt><a name="label-67" id="label-67"><code>scan(<var>pattern</var>)</code></a></dt><!-- RDLabel: "scan" --> <dd> -<p>return an array of all occurence matched by <var>pattern</var> </p></dd> -<dt><a name="label:68" id="label:68"><code>scan(<var>pattern</var>) {|<var>str</var>| ...}</code></a></dt><!-- RDLabel: "scan" --> +return an array of all occurence matched by <var>pattern</var> </dd> +<dt><a name="label-68" id="label-68"><code>scan(<var>pattern</var>) {|<var>str</var>| ...}</code></a></dt><!-- RDLabel: "scan" --> <dd> -<p>iterate through the file, matching the <var>pattern</var></p></dd> -<dt><a name="label:69" id="label:69"><code>size</code></a></dt><!-- RDLabel: "size" --> +iterate through the file, matching the <var>pattern</var></dd> +<dt><a name="label-69" id="label-69"><code>size</code></a></dt><!-- RDLabel: "size" --> <dd> -<p>return the size of the file</p></dd> -<dt><a name="label:70" id="label:70"><code>slice</code></a></dt><!-- RDLabel: "slice" --> +return the size of the file</dd> +<dt><a name="label-70" id="label-70"><code>slice</code></a></dt><!-- RDLabel: "slice" --> <dd> -<p>same than <var>[]</var></p></dd> -<dt><a name="label:71" id="label:71"><code>slice!</code></a></dt><!-- RDLabel: "slice!" --> +same than <var>[]</var></dd> +<dt><a name="label-71" id="label-71"><code>slice!</code></a></dt><!-- RDLabel: "slice!" --> <dd> -<p>delete the specified portion of the file</p></dd> -<dt><a name="label:72" id="label:72"><code>split([<var>sep</var>[, <var>limit</var>]])</code></a></dt><!-- RDLabel: "split" --> +delete the specified portion of the file</dd> +<dt><a name="label-72" id="label-72"><code>split([<var>sep</var>[, <var>limit</var>]])</code></a></dt><!-- RDLabel: "split" --> <dd> -<p>splits into a list of strings and return this array</p></dd> -<dt><a name="label:73" id="label:73"><code>squeeze!([<var>str</var>])</code></a></dt><!-- RDLabel: "squeeze!" --> +splits into a list of strings and return this array</dd> +<dt><a name="label-73" id="label-73"><code>squeeze!([<var>str</var>])</code></a></dt><!-- RDLabel: "squeeze!" --> <dd> -<p>squeezes sequences of the same characters which is included in <var>str</var></p></dd> -<dt><a name="label:74" id="label:74"><code>strip!</code></a></dt><!-- RDLabel: "strip!" --> +squeezes sequences of the same characters which is included in <var>str</var></dd> +<dt><a name="label-74" id="label-74"><code>strip!</code></a></dt><!-- RDLabel: "strip!" --> <dd> -<p>removes leading and trailing whitespace</p></dd> -<dt><a name="label:75" id="label:75"><code>sub!(<var>pattern</var>, <var>replace</var>)</code></a></dt><!-- RDLabel: "sub!" --> +removes leading and trailing whitespace</dd> +<dt><a name="label-75" id="label-75"><code>sub!(<var>pattern</var>, <var>replace</var>)</code></a></dt><!-- RDLabel: "sub!" --> <dd> -<p>substitution </p></dd> -<dt><a name="label:76" id="label:76"><code>sub!(<var>pattern</var>) {|<var>str</var>| ...}</code></a></dt><!-- RDLabel: "sub!" --> +substitution </dd> +<dt><a name="label-76" id="label-76"><code>sub!(<var>pattern</var>) {|<var>str</var>| ...}</code></a></dt><!-- RDLabel: "sub!" --> <dd> -<p>substitution</p></dd> -<dt><a name="label:77" id="label:77"><code>sum([<var>bits</var>])</code></a></dt><!-- RDLabel: "sum" --> +substitution</dd> +<dt><a name="label-77" id="label-77"><code>sum([<var>bits</var>])</code></a></dt><!-- RDLabel: "sum" --> <dd> -<p>return a checksum</p></dd> -<dt><a name="label:78" id="label:78"><code>swapcase!</code></a></dt><!-- RDLabel: "swapcase!" --> +return a checksum</dd> +<dt><a name="label-78" id="label-78"><code>swapcase!</code></a></dt><!-- RDLabel: "swapcase!" --> <dd> -<p>replaces all lowercase characters to uppercase characters, and vice-versa</p></dd> -<dt><a name="label:79" id="label:79"><code>tr!(<var>search</var>, <var>replace</var>)</code></a></dt><!-- RDLabel: "tr!" --> +replaces all lowercase characters to uppercase characters, and vice-versa</dd> +<dt><a name="label-79" id="label-79"><code>tr!(<var>search</var>, <var>replace</var>)</code></a></dt><!-- RDLabel: "tr!" --> <dd> -<p>translate the character from <var>search</var> to <var>replace</var> </p></dd> -<dt><a name="label:80" id="label:80"><code>tr_s!(<var>search</var>, <var>replace</var>)</code></a></dt><!-- RDLabel: "tr_s!" --> +translate the character from <var>search</var> to <var>replace</var> </dd> +<dt><a name="label-80" id="label-80"><code>tr_s!(<var>search</var>, <var>replace</var>)</code></a></dt><!-- RDLabel: "tr_s!" --> <dd> -<p>translate the character from <var>search</var> to <var>replace</var>, then -squeeze sequence of the same characters </p></dd> -<dt><a name="label:81" id="label:81"><code>upcase!</code></a></dt><!-- RDLabel: "upcase!" --> +translate the character from <var>search</var> to <var>replace</var>, then +squeeze sequence of the same characters </dd> +<dt><a name="label-81" id="label-81"><code>upcase!</code></a></dt><!-- RDLabel: "upcase!" --> <dd> -<p>replaces all lowercase characters to downcase characters</p></dd> +replaces all lowercase characters to downcase characters</dd> </dl> </body> @@ -3,12 +3,10 @@ ((<Download|URL:ftp://moulon.inra.fr/pub/ruby/>)) -#^ The Mmap class implement memory-mapped file objects === WARNING === The variables $' and $` are not available with gsub! and sub! -#^ == SuperClass @@ -18,10 +16,7 @@ Object * Comparable * Enumerable -# class Mmap -# include Comparable -# include Enumerable -# class << self + == Class Methods --- lockall(flag) @@ -69,7 +64,6 @@ Object --- unlockall reenable paging -# end == Methods --- extend(count) |