| mn8 Language Reference | Index | ||
MemHandler |
||
|
||
Helper concept to use mn8 environment variables. Mem Handler concept can get and set mn8 environment variables.
URL format is : mem://<path>
Possible options :
Set the crow password in mn8 environment and displays it.
"crowp" to "mem:/passwd/crow"
$x from "mem:/passwd/crow"
print $x
crowp
print the '/passwd/' passwords where password contains ro string
$x from "mem:/passwd/" options "filter"=Simplex.create("*ro*")
print $x
| Version: | 0.1 |
| Authors: | Szabo Csaba () |
| Location: | |
| Inherits: | Concept, URIHandler |
| create (String $url) |
| static Logical | acceptsURI (String $uri) |
| Logical | closeConnection |
| Concept | getContent |
| Logical | initialize (Map ) |
| Logical | openConnection |
| Logical | setContent (Concept $value) |
| create (String $url) |
| Parameters: | ||
|
Creates a new MemHandler with the given $url.
| static acceptsURI (String $uri) |
| Parameters: | ||
|
| Returns: Logical |
Returns true if the given $uri is acceptable by this handler, false otherwise.
print MemHandler.acceptsURI("mem://user/passwds")
-- the result is --
true
| closeConnection |
| Returns: Logical |
Returns true and close this connection.
$url = "mem://user/passwds/crow"
$mem = MemHandler.create( $url )
if $mem.acceptsURI( $url ) then [
$m typeof Map
if ( $mem.initialize( $m ) ) then [
if ( $mem.openConnection ) then [
$mem.setContent("crowp")
print $mem.getContent
$mem.closeConnection
]
]
]
-- the result is --
crowp
| getContent |
| Returns: Concept |
| Exceptions: | |
| badURLException : (Warning) | If the specified URL isn't valid. |
Returns the content of this handler.
$url = "mem://user/passwds/crow"
$mem = MemHandler.create( $url )
if $mem.acceptsURI( $url ) then [
$m typeof Map
if ( $mem.initialize( $m ) ) then [
if ( $mem.openConnection ) then [
$mem.setContent("crowp")
print $mem.getContent
$mem.closeConnection
]
]
]
-- the result is --
crowp
| initialize (Map ) |
| Parameters: | ||
|
| Returns: Logical |
Returns true.
$url = "mem://user/passwds/crow"
$mem = MemHandler.create( $url )
if $mem.acceptsURI( $url ) then [
$m typeof Map
if ( $mem.initialize( $m ) ) then [
if ( $mem.openConnection ) then [
$mem.setContent("crowp")
print $mem.getContent
$mem.closeConnection
]
]
]
-- the result is --
crowp
| openConnection |
| Returns: Logical |
Returns true.
$url = "mem://user/passwds/crow"
$mem = MemHandler.create( $url )
if $mem.acceptsURI( $url ) then [
$m typeof Map
if ( $mem.initialize( $m ) ) then [
if ( $mem.openConnection ) then [
$mem.setContent("crowp")
print $mem.getContent
$mem.closeConnection
]
]
]
-- the result is --
crowp
| setContent (Concept $value) |
| Parameters: | ||
|
| Returns: Logical |
| Exceptions: | |
| bindException : (Error) | If unable to put $value to mn8 environment. |
Returns true if sets the content successfully to the given $value, false otherwise.
$url = "mem://user/passwds/crow"
$mem = MemHandler.create( $url )
if $mem.acceptsURI( $url ) then [
$m typeof Map
if ( $mem.initialize( $m ) ) then [
if ( $mem.openConnection ) then [
$mem.setContent("crowp")
print $mem.getContent
$mem.closeConnection
]
]
]
-- the result is --
crowp