Linux and UNIX Man Pages

Linux & Unix Commands - Search Man Pages

stream(3) [centos man page]

Stream(3)							   OCaml library							 Stream(3)

NAME
Stream - Streams and parsers. Module Module Stream Documentation Module Stream : sig end Streams and parsers. type 'a t The type of streams holding values of type 'a . exception Failure Raised by parsers when none of the first components of the stream patterns is accepted. exception Error of string Raised by parsers when the first component of a stream pattern is accepted, but one of the following components is rejected. === Stream builders === val from : (int -> 'a option) -> 'a t Stream.from f returns a stream built from the function f . To create a new stream element, the function f is called with the current stream count. The user function f must return either Some <value> for a value or None to specify the end of the stream. val of_list : 'a list -> 'a t Return the stream holding the elements of the list in the same order. val of_string : string -> char t Return the stream of the characters of the string parameter. val of_channel : Pervasives.in_channel -> char t Return the stream of the characters read from the input channel. === Stream iterator === val iter : ('a -> unit) -> 'a t -> unit Stream.iter f s scans the whole stream s, applying function f in turn to each stream element encountered. === Predefined parsers === val next : 'a t -> 'a Return the first element of the stream and remove it from the stream. Raise Stream.Failure if the stream is empty. val empty : 'a t -> unit Return () if the stream is empty, else raise Stream.Failure . === Useful functions === val peek : 'a t -> 'a option Return Some of "the first element" of the stream, or None if the stream is empty. val junk : 'a t -> unit Remove the first element of the stream, possibly unfreezing it before. val count : 'a t -> int Return the current count of the stream elements, i.e. the number of the stream elements discarded. val npeek : int -> 'a t -> 'a list npeek n returns the list of the n first elements of the stream, or all its remaining elements if less than n elements are available. OCamldoc 2014-06-09 Stream(3)

Check Out this Related Man Page

XML::Stream::Namespace(3pm)				User Contributed Perl Documentation			       XML::Stream::Namespace(3pm)

NAME
XML::Stream::Namespace - Object to make defining Namespaces easier in XML::Stream. SYNOPSIS
XML::Stream::Namespace is a helper package to XML::Stream. It provides a clean way of defining Namespaces for XML::Stream to use when connecting. DESCRIPTION
This module allows you to set and read elements from an XML::Stream Namespace. METHODS
SetNamespace("mynamespace"); SetXMLNS("http://www.mynamespace.com/xmlns"); SetAttributes(attrib1=>"value1", attrib2=>"value2"); GetNamespace() returns "mynamespace" GetXMLNS() returns "http://www.mynamespace.com/xmlns" GetAttributes() returns a hash ( attrib1=>"value1",attrib2=>"value2") GetStream() returns the following string: "xmlns:mynamespace='http://www.nynamespace.com/xmlns' mynamespace:attrib1='value1' mynamespace:attrib2='value2'" EXAMPLES
$myNamespace = new XML::Stream::Namespace("mynamspace"); $myNamespace->SetXMLNS("http://www.mynamespace.org/xmlns"); $myNamespace->SetAttributes(foo=>"bar", bob=>"vila"); $stream = new XML::Stream; $stream->Connect(name=>"foo.bar.org", port=>1234, namespace=>"foo:bar", namespaces=>[ $myNamespace ]); # # The above Connect will send the following as the opening string # of the stream to foo.bar.org:1234... # # <stream:stream # xmlns:stream="http://etherx.jabber.org/streams" # to="foo.bar.org" # xmlns="foo:bar" # xmlns:mynamespace="http://www.mynamespace.org/xmlns" # mynamespace:foo="bar" # mynamespace:bob="vila"> # AUTHOR
Written by Ryan Eatmon in February 2000 Idea By Thomas Charron in January of 2000 for http://etherx.jabber.org/streams/ Currently maintained by Darian Anthony Patrick. COPYRIGHT
This module is free software; you can redistribute it and/or modify it under the same terms as Perl itself. perl v5.14.2 2010-01-08 XML::Stream::Namespace(3pm)
Man Page