X7ROOT File Manager
Current Path:
/usr/share/swig/2.0.10/ruby
usr
/
share
/
swig
/
2.0.10
/
ruby
/
📁
..
📄
Makefile.swig
(943 B)
📄
argcargv.i
(1.2 KB)
📄
attribute.i
(34 B)
📄
carrays.i
(129 B)
📄
cdata.i
(30 B)
📄
cmalloc.i
(32 B)
📄
cni.i
(42 B)
📄
cpointer.i
(33 B)
📄
cstring.i
(32 B)
📄
director.swg
(8.11 KB)
📄
embed.i
(169 B)
📄
exception.i
(126 B)
📄
extconf.rb
(234 B)
📄
factory.i
(32 B)
📄
file.i
(639 B)
📄
jstring.i
(952 B)
📄
progargcargv.i
(770 B)
📄
ruby.swg
(2.59 KB)
📄
rubyapi.swg
(801 B)
📄
rubyautodoc.swg
(4.26 KB)
📄
rubyclasses.swg
(11.1 KB)
📄
rubycomplex.swg
(3.63 KB)
📄
rubycontainer.swg
(26.47 KB)
📄
rubycontainer_extended.swg
(3.46 KB)
📄
rubydef.swg
(42 B)
📄
rubyerrors.swg
(3.63 KB)
📄
rubyfragments.swg
(552 B)
📄
rubyhead.swg
(4.18 KB)
📄
rubyinit.swg
(39 B)
📄
rubyiterators.swg
(22.29 KB)
📄
rubykw.swg
(1.15 KB)
📄
rubymacros.swg
(456 B)
📄
rubyopers.swg
(1.81 KB)
📄
rubyprimtypes.swg
(5.09 KB)
📄
rubyrun.swg
(13.24 KB)
📄
rubyruntime.swg
(423 B)
📄
rubystdautodoc.swg
(1.78 KB)
📄
rubystdcommon.swg
(5.01 KB)
📄
rubystdfunctors.swg
(4.1 KB)
📄
rubystrings.swg
(1.53 KB)
📄
rubytracking.swg
(5.04 KB)
📄
rubytypemaps.swg
(1.76 KB)
📄
rubyuserdir.swg
(657 B)
📄
rubywstrings.swg
(2.4 KB)
📄
std_alloc.i
(27 B)
📄
std_basic_string.i
(2.58 KB)
📄
std_char_traits.i
(33 B)
📄
std_common.i
(2.28 KB)
📄
std_complex.i
(471 B)
📄
std_container.i
(60 B)
📄
std_deque.i
(732 B)
📄
std_except.i
(35 B)
📄
std_functors.i
(768 B)
📄
std_ios.i
(380 B)
📄
std_iostream.i
(227 B)
📄
std_list.i
(1.01 KB)
📄
std_map.i
(10.89 KB)
📄
std_multimap.i
(5.94 KB)
📄
std_multiset.i
(1.37 KB)
📄
std_pair.i
(5.21 KB)
📄
std_queue.i
(851 B)
📄
std_set.i
(6.38 KB)
📄
std_sstream.i
(30 B)
📄
std_stack.i
(853 B)
📄
std_streambuf.i
(31 B)
📄
std_string.i
(190 B)
📄
std_vector.i
(1.19 KB)
📄
std_vectora.i
(950 B)
📄
std_wstring.i
(65 B)
📄
stl.i
(357 B)
📄
timeval.i
(1.15 KB)
📄
typemaps.i
(11.05 KB)
Editing: rubycontainer_extended.swg
/* ----------------------------------------------------------------------------- * rubycontainer_extended.swg * * This file contains additional functions that make containers * behave closer to ruby primitive types. * However, some of these functions place some restrictions on * the underlying object inside of the container and the iterator * (that it has to have an == comparison function, that it has to have * an = assignment operator, etc). * ----------------------------------------------------------------------------- */ /** * Macro used to add extend functions that require operator== in object. * * @param Container STL container * @param Type class inside container * */ %define %swig_container_with_equal_operator( Container, Type ) VALUE __delete__( const Type& val ) { VALUE r = Qnil; Container<Type >::iterator e = $self->end(); Container<Type >::iterator i = std::remove( $self->begin(), e, val ); // remove dangling elements now $self->erase( i, e ); if ( i != e ) r = swig::from< Type >( val ); else if ( rb_block_given_p() ) r = rb_yield(Qnil); return r; } %enddef // end of %swig_container_with_equal_operator /** * Macro used to add extend functions that require the assignment * operator (ie. = ) of contained class * * @param Container STL container * @param Type class inside container * */ %define %swig_container_with_assignment( Container, Type ) // // map! -- the equivalent of std::transform // Container< Type >* map_bang() { if ( !rb_block_given_p() ) rb_raise( rb_eArgError, "No block given" ); VALUE r = Qnil; Container< Type >::iterator i = $self->begin(); Container< Type >::iterator e = $self->end(); try { for ( ; i != e; ++i ) { r = swig::from< Type >( *i ); r = rb_yield( r ); *i = swig::as< Type >( r ); } } catch ( const std::invalid_argument& ) { rb_raise(rb_eTypeError, "Yield block did not return a valid element for " "Container"); } return $self; } %enddef // end of %swig_container_with_assignment /** * Macro used to add all extended functions to a container * * @param Container STL container * @param Type class inside container * */ %define %swig_container_extend( Container, Type ) %extend Container< Type > { %swig_container_with_assignment( %arg(Container), Type ); %swig_container_with_equal_operator( %arg(Container), Type ); } %enddef /** * Private macro used to add all extended functions to C/C++ * primitive types * * @param Container an STL container, like std::vector (with no class template) * */ %define %__swig_container_extend_primtypes( Container ) %swig_container_extend( %arg( Container ), bool ); %swig_container_extend( %arg( Container ), char ); %swig_container_extend( %arg( Container ), short ); %swig_container_extend( %arg( Container ), int ); %swig_container_extend( %arg( Container ), unsigned short ); %swig_container_extend( %arg( Container ), unsigned int ); %swig_container_extend( %arg( Container ), float ); %swig_container_extend( %arg( Container ), double ); %swig_container_extend( %arg( Container ), std::complex ); %swig_container_extend( %arg( Container ), std::string ); %swig_container_extend( %arg( Container ), swig::GC_VALUE ); %enddef %__swig_container_extend_primtypes( std::vector ); %__swig_container_extend_primtypes( std::deque ); %__swig_container_extend_primtypes( std::list );
Upload File
Create Folder