VOS: Difference between revisions
Appearance
mNo edit summary |
mNo edit summary |
||
(One intermediate revision by the same user not shown) | |||
Line 2: | Line 2: | ||
==Synopsis== | ==Synopsis== | ||
;Header: <tt><v/vos.h></tt> | |||
; | ;Class name: vOS | ||
: <tt><v/vos.h></tt> | |||
; | |||
: vOS | |||
==Description== | ==Description== | ||
This class is meant to provide a fairly platform independent way of interfacing with common system dependent functions. | This class is meant to provide a fairly platform independent way of interfacing with common system dependent functions. | ||
==Methods== | ==Methods== | ||
;int vDeleteFile(const char* filename):Deletes the specified file. | |||
;int vChDrive(int drive):On MS-Windows, changes to the specified disk drive, where "A:"==0, "B:"==1, and so on. This method has no effect on X. | |||
;int vGenEnvVal(char* name, char* val, int maxlen):Returns to <tt>val</tt> the value of the environment variable specified in <tt>name</tt>. <tt>val</tt> has a maximum length of <tt>maxlen</tt>. The return value is <tt>false</tt> on failure to find the variable. | |||
Deletes the specified file. | ;int vGetUserName(char* s, int len):Returns to <tt>s</tt> a system dependent string corresponding to the current User Name. | ||
;void vGetHostName(char* s, int len):Returns to <tt>s</tt> a system dependent string corresponding to the host name of the system. | |||
;long vGetPid():Returns a system dependent value corresponding to the current process id. | |||
;int vGetCWD(char* s, int len):Returns to <tt>s</tt> a system dependent string corresponding to the current working directory. | |||
On MS-Windows, changes to the specified disk drive, where "A:"==0, "B:"==1, and so on. This method has no effect on X. | ;int vChDir(const char* path):Changes active directory to the one specified by <tt>path</tt>. | ||
;int vRunProcess(const char* cmd, const char* StdOut, const char* StdErr, int Wait, int minimize):This function is used to start an external process. <tt>cmd</tt> is used to specify the complete command line, e.g., "prog -s x.tmp". <tt>StdOut</tt> and <tt>StdErr</tt> may be used to specify a file name. If supplied, then standard out and standard error of the process will be redirected to those files. If <tt>Wait</tt> is true, then <tt>vRunProcess</tt> won't return until the process has terminated. If <tt>minimize</tt> is true, then the process will be started in a minimized state. <tt>vRunProcess</tt> return the exit code of the process. | |||
Returns to <tt>val</tt> the value of the environment variable specified in <tt>name</tt>. <tt>val</tt> has a maximum length of <tt>maxlen</tt>. The return value is <tt>false</tt> on failure to find the variable. | |||
Returns to <tt>s</tt> a system dependent string corresponding to the current User Name. | |||
Returns to <tt>s</tt> a system dependent string corresponding to the host name of the system. | |||
Returns a system dependent value corresponding to the current process id. | |||
Returns to <tt>s</tt> a system dependent string corresponding to the current working directory. | |||
Changes active directory to the one specified by <tt>path</tt>. | |||
This function is used to start an external process. <tt>cmd</tt> is used to specify the complete command line, e.g., "prog -s x.tmp". <tt>StdOut</tt> and <tt>StdErr</tt> may be used to specify a file name. If supplied, then standard out and standard error of the process will be redirected to those files. If <tt>Wait</tt> is true, then <tt>vRunProcess</tt> won't return until the process has terminated. If <tt>minimize</tt> is true, then the process will be started in a minimized state. <tt>vRunProcess</tt> return the exit code of the process. | |||
[[Category:V C++ GUI Framework]] | [[Category:V C++ GUI Framework]] |
Latest revision as of 22:30, 9 April 2020
A class to interface with the host operating system in a platform independent fashion.
Synopsis
- Header
- <v/vos.h>
- Class name
- vOS
Description
This class is meant to provide a fairly platform independent way of interfacing with common system dependent functions.
Methods
- int vDeleteFile(const char* filename)
- Deletes the specified file.
- int vChDrive(int drive)
- On MS-Windows, changes to the specified disk drive, where "A:"==0, "B:"==1, and so on. This method has no effect on X.
- int vGenEnvVal(char* name, char* val, int maxlen)
- Returns to val the value of the environment variable specified in name. val has a maximum length of maxlen. The return value is false on failure to find the variable.
- int vGetUserName(char* s, int len)
- Returns to s a system dependent string corresponding to the current User Name.
- void vGetHostName(char* s, int len)
- Returns to s a system dependent string corresponding to the host name of the system.
- long vGetPid()
- Returns a system dependent value corresponding to the current process id.
- int vGetCWD(char* s, int len)
- Returns to s a system dependent string corresponding to the current working directory.
- int vChDir(const char* path)
- Changes active directory to the one specified by path.
- int vRunProcess(const char* cmd, const char* StdOut, const char* StdErr, int Wait, int minimize)
- This function is used to start an external process. cmd is used to specify the complete command line, e.g., "prog -s x.tmp". StdOut and StdErr may be used to specify a file name. If supplied, then standard out and standard error of the process will be redirected to those files. If Wait is true, then vRunProcess won't return until the process has terminated. If minimize is true, then the process will be started in a minimized state. vRunProcess return the exit code of the process.