CFx SDK Documentation 2026 SP0
Loading...
Searching...
No Matches
RxSystemServices.h
Go to the documentation of this file.
1
2// Copyright (C) 2002-2024, Open Design Alliance (the "Alliance").
3// All rights reserved.
4//
5// This software and its documentation and related materials are owned by
6// the Alliance. The software may only be incorporated into application
7// programs owned by members of the Alliance, subject to a signed
8// Membership Agreement and Supplemental Software License Agreement with the
9// Alliance. The structure and organization of this software are the valuable
10// trade secrets of the Alliance and its suppliers. The software is also
11// protected by copyright law and international treaty provisions. Application
12// programs incorporating this software must include the following statement
13// with their copyright notices:
14//
15// This application incorporates Open Design Alliance software pursuant to a license
16// agreement with Open Design Alliance.
17// Open Design Alliance Copyright (C) 2002-2024 by Open Design Alliance.
18// All rights reserved.
19//
20// By use of this software, its documentation or related materials, you
21// acknowledge and accept the above terms.
23
24
25#ifndef _ODRXSYSTEMSERVICES_INCLUDED_
26#define _ODRXSYSTEMSERVICES_INCLUDED_
27
28#include <stdarg.h>
29
30#include "RxObject.h"
31#include "OdStreamBuf.h"
32#include "OdCodePage.h"
33#include "LoadReasons.h"
34#if defined(_DEBUG) && defined(_WIN32)
35#define STL_USING_VECTOR
36#include "OdaSTL.h"
37#endif
38
39class OdTimeStamp;
40class OdRxModule;
41class OdRxDictionary;
43
44#include "TD_PackPush.h"
45
50namespace Oda
51{
53 {
54 kUserId = 1, //Current user id
55 kUserName = 2 //A "friendly" user name (for example, Jeff Smith).
56 };
57}
58
80
97
114
131
143
155
164class FIRSTDLL_EXPORT OdRxSystemServices : public OdRxObject
165{
166public:
167
169 {
170#if defined _WIN32_WCE
171 srand(GetTickCount());
172#else
173 Od_srand((unsigned int) time(0));
174#endif
175 }
176
177
218 const OdString& filename,
222
240 virtual bool accessFile(const OdString& filename, int accessMode);
241
249 virtual OdInt64 getFileCTime(const OdString& filename) = 0;
250
258 virtual OdInt64 getFileMTime(const OdString& filename) = 0;
259
267 virtual OdInt64 getFileSize(const OdString& filename) = 0;
268
269
275 virtual OdString formatMessage(unsigned int formatId, va_list* argList= 0) = 0;
276
283 virtual OdString formatMsg(unsigned int formatId, ...);
284
288 virtual OdCodePageId systemCodePage() const = 0;
289
294
299
311 virtual OdRxModule* loadModule(const OdString& moduleFileName, bool silent);
312
318 virtual void unloadModule(OdRxModule* pModuleObj);
319
325 virtual OdString findModule(const OdString& applicationName);
326 virtual OdString findModule(const OdString& applicationName, OdaApp::LoadReasons loadReason);
327
333 virtual void warning(const OdString& message);
334
341 virtual void warning(const char* warnVisGroup, const OdString& message);
342
353 static OdRxModule* loadModuleLib(const OdString& moduleFileName, bool silent);
354
367
374 virtual OdResult getEnvVar(const OdString &varName, OdString &value) = 0;
375
382 virtual OdResult setEnvVar(const OdString &varName, const OdString &newValue) = 0;
383
387 virtual OdString getTemporaryPath() const;
388
393
398
399#if defined(_DEBUG) && defined(_WIN32)
400 static void dontFreeLibrary(std::vector<HMODULE>* notFreedDlls) { s_notFreedDlls = notFreedDlls; }
401private:
402 FIRSTDLL_EXPORT_STATIC static std::vector<HMODULE>* s_notFreedDlls;
403#endif
404};
405
409
411
412#include "TD_PackPop.h"
413
414#endif // #ifndef _ODRXSYSTEMSERVICES_INCLUDED_
OdSmartPtr< OdStreamBuf > OdStreamBufPtr
OdSmartPtr< OdRxSystemServices > OdRxSystemServicesPtr
OdSmartPtr< OdRxDictionary > OdRxDictionaryPtr
Definition Gs.h:93
OdCodePageId
Definition OdCodePage.h:31
#define Od_srand
OdResult
Definition OdResult.h:29
#define FIRSTDLL_EXPORT
Definition RootExport.h:39
#define FIRSTDLL_EXPORT_STATIC
Definition RootExport.h:40
FIRSTDLL_EXPORT OdRxSystemServices * odrxSystemServices()
OdError_CantOpenFile(const OdString &filename)
OdError_CantOpenFile(OdErrorContext *context)
OdString getFileName() const
OdError_FileException(OdResult code, const OdString &filename, const OdString &extended=OdString::kEmpty)
OdError_FileException(OdErrorContext *context)
OdError_FileNotFound(OdErrorContext *context)
OdError_FileNotFound(const OdString &filename)
OdError_FileWriteError(OdErrorContext *context)
OdError_FileWriteError(const OdString &filename)
OdResult code() const
OdError(OdResult code)
const OdErrorContext * context() const
virtual OdCodePageId systemCodePage() const =0
virtual OdStreamBufPtr createFile(const OdString &filename, Oda::FileAccessMode accessMode=Oda::kFileRead, Oda::FileShareMode shareMode=Oda::kShareDenyNo, Oda::FileCreationDisposition creationDisposition=Oda::kOpenExisting)
virtual OdString formatMessage(unsigned int formatId, va_list *argList=0)=0
virtual OdResult getEnvVar(const OdString &varName, OdString &value)=0
virtual void warning(const char *warnVisGroup, const OdString &message)
virtual OdString getUserName(Oda::UserNameFormat unFormat=Oda::kUserId)
virtual OdRxModule * loadModule(const OdString &moduleFileName, bool silent)
virtual OdInt64 getFileSize(const OdString &filename)=0
virtual void unloadModule(OdRxModule *pModuleObj)
virtual OdGUID createOdGUID()
virtual OdResult uninitModelerLibrary(OdRxDictionary *pDict)
virtual OdString getTemporaryPath() const
static OdRxModule * loadModuleLib(const OdString &moduleFileName, bool silent)
virtual void warning(const OdString &message)
virtual bool accessFile(const OdString &filename, int accessMode)
virtual OdResult initModelerLibrary(OdRxDictionary *pDict)
virtual OdInt64 getFileMTime(const OdString &filename)=0
virtual OdString createGuid()
virtual OdString formatMsg(unsigned int formatId,...)
virtual OdString findModule(const OdString &applicationName)
virtual OdString getTempFileName()
virtual OdInt64 getFileCTime(const OdString &filename)=0
virtual OdResult setEnvVar(const OdString &varName, const OdString &newValue)=0
virtual OdString findModule(const OdString &applicationName, OdaApp::LoadReasons loadReason)
FIRSTDLL_EXPORT_STATIC static const OdString kEmpty
Definition OdString.h:100
GLsizei const GLfloat * value
Definition gles2_ext.h:302
Definition TxDefs.h:49
FileShareMode
Definition OdStreamBuf.h:65
@ kShareDenyNo
Definition OdStreamBuf.h:69
FileCreationDisposition
Definition OdStreamBuf.h:74
@ kOpenExisting
Definition OdStreamBuf.h:77
FileAccessMode
Definition OdStreamBuf.h:48
@ kFileRead
Definition OdStreamBuf.h:49