1 | // tMachine.h  |
2 | //  |
3 | // Hardware ans OS access functions like querying supported instruction sets, number or cores, and computer name/ip  |
4 | // accessors.  |
5 | //  |
6 | // Copyright (c) 2004-2006, 2017, 2020 Tristan Grimmer.  |
7 | // Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby  |
8 | // granted, provided that the above copyright notice and this permission notice appear in all copies.  |
9 | //  |
10 | // THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL  |
11 | // IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,  |
12 | // INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN  |
13 | // AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR  |
14 | // PERFORMANCE OF THIS SOFTWARE.  |
15 |   |
16 | #pragma once  |
17 | #include <Foundation/tString.h>  |
18 | #include "System/tThrow.h"  |
19 | #include "System/tPrint.h"  |
20 | namespace tSystem  |
21 | {  |
22 |   |
23 |   |
24 | // Returns true if the processor and the OS support Streaming SIMD Extensions.  |
25 | bool tSupportsSSE();  |
26 | bool tSupportsSSE2();  |
27 |   |
28 | // Returns the computer's name.  |
29 | tString tGetCompName();  |
30 |   |
31 | // Returns an environment variable value.  |
32 | tString tGetEnvVar(const tString& envVarName);  |
33 |   |
34 | // Returns the number of cores (processors) the current machine has.  |
35 | int tGetNumCores();  |
36 |   |
37 | // Opens the OS's file explorer for the folder and file specified. If file doesn't exist, no file will be selected.  |
38 | // If dir doesn't exist, an explorer window is opened at a location decided by the system.  |
39 | bool tOpenSystemFileExplorer(const tString& dir, const tString& file);  |
40 | bool tOpenSystemFileExplorer(const tString& fullFilename);  |
41 |   |
42 |   |
43 | }  |
44 | |