File: environment.h.html

package info (click to toggle)
rudiments 0.31-2
  • links: PTS
  • area: main
  • in suites: lenny
  • size: 7,516 kB
  • ctags: 3,248
  • sloc: asm: 23,776; cpp: 22,792; sh: 7,769; ansic: 1,769; makefile: 1,054; xml: 169; perl: 19
file content (68 lines) | stat: -rw-r--r-- 4,587 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
<html>
<head>
<title>~/src/firstworks/rudiments-0.31/include/rudiments/environment.h.html</title>
<meta name="Generator" content="Vim/7.0">
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
</head>
<body bgcolor="#ffffff" text="#000000">
<pre>
<font color="#0000ff">// Copyright (c) 2003 David Muse</font>
<font color="#0000ff">// See the COPYING file for more information.</font>

<font color="#a020f0">#ifndef RUDIMENTS_ENVIRONMENT_H</font>
<font color="#a020f0">#define RUDIMENTS_ENVIRONMENT_H</font>

<font color="#a020f0">#include </font><font color="#ff00ff">&lt;rudiments/private/environmentincludes.h&gt;</font>

<font color="#0000ff">// The environment class provides methods for accessing and manipulating</font>
<font color="#0000ff">// environment variables.</font>

<font color="#a020f0">#ifdef RUDIMENTS_NAMESPACE</font>
<font color="#2e8b57"><b>namespace</b></font> rudiments {
<font color="#a020f0">#endif</font>

<font color="#2e8b57"><b>class</b></font> environmentprivate;

<font color="#2e8b57"><b>class</b></font> environment {
        <font color="#a52a2a"><b>public</b></font>:
                <font color="#2e8b57"><b>static</b></font>        <font color="#2e8b57"><b>const</b></font> <font color="#2e8b57"><b>char</b></font>     *getValue(<font color="#2e8b57"><b>const</b></font> <font color="#2e8b57"><b>char</b></font> *variable);
                                        <font color="#0000ff">// Returns the value of &quot;variable&quot;.</font>
                <font color="#2e8b57"><b>static</b></font>        <font color="#2e8b57"><b>bool</b></font>           setValue(<font color="#2e8b57"><b>const</b></font> <font color="#2e8b57"><b>char</b></font> *variable,
                                                <font color="#2e8b57"><b>const</b></font> <font color="#2e8b57"><b>char</b></font> *value);
                                        <font color="#0000ff">// Sets the value of &quot;variable&quot; to</font>
                                        <font color="#0000ff">// &quot;value&quot;, overwriting any value that</font>
                                        <font color="#0000ff">// &quot;variable&quot; previously had.</font>
                                        <font color="#0000ff">// Returns true on success and false on</font>
                                        <font color="#0000ff">// failure.</font>
                <font color="#2e8b57"><b>static</b></font>        <font color="#2e8b57"><b>bool</b></font>           remove(<font color="#2e8b57"><b>const</b></font> <font color="#2e8b57"><b>char</b></font> *variable);
                                        <font color="#0000ff">// Removes &quot;variable&quot; from the</font>
                                        <font color="#0000ff">// environment.</font>

                <font color="#2e8b57"><b>static</b></font>        <font color="#2e8b57"><b>const</b></font> <font color="#2e8b57"><b>char</b></font> * <font color="#2e8b57"><b>const</b></font>     *variables();
                        <font color="#0000ff">// Returns a NULL terminated list of all</font>
                        <font color="#0000ff">// environment variables.  Each entry in the list is</font>
                        <font color="#0000ff">// of the form NAME=VALUE.</font>

                <font color="#2e8b57"><b>static</b></font>        <font color="#2e8b57"><b>bool</b></font>   clear();
                                <font color="#0000ff">// Clears the environment of all name-value</font>
                                <font color="#0000ff">// pairs.  After calling this, variables()</font>
                                <font color="#0000ff">// will return NULL.</font>

                <font color="#2e8b57"><b>static</b></font>        <font color="#2e8b57"><b>void</b></font>   print();
                                <font color="#0000ff">// Prints the environment variable list to</font>
                                <font color="#0000ff">// stdout.</font>

                <font color="#2e8b57"><b>static</b></font>        <font color="#2e8b57"><b>void</b></font>   setMutex(mutex *mtx);
                        <font color="#0000ff">// Allows you to supply a mutex if the class needs it.</font>
                        <font color="#0000ff">// If your application is not multithreaded, then</font>
                        <font color="#0000ff">// there is no need to supply a mutex.</font>
};

<font color="#a020f0">#ifdef RUDIMENTS_NAMESPACE</font>
}
<font color="#a020f0">#endif</font>

<font color="#a020f0">#endif</font>
</pre>
</body>
</html>