1 | /* $Id: ExtPackUtil.h 33806 2010-11-05 17:20:15Z vboxsync $ */
|
---|
2 | /** @file
|
---|
3 | * VirtualBox Main - Extension Pack Utilities and definitions, VBoxC, VBoxSVC, ++.
|
---|
4 | */
|
---|
5 |
|
---|
6 | /*
|
---|
7 | * Copyright (C) 2010 Oracle Corporation
|
---|
8 | *
|
---|
9 | * Oracle Corporation confidential
|
---|
10 | * All rights reserved
|
---|
11 | */
|
---|
12 |
|
---|
13 | #ifndef ____H_EXTPACKUTIL
|
---|
14 | #define ____H_EXTPACKUTIL
|
---|
15 |
|
---|
16 | #include <iprt/cpp/ministring.h>
|
---|
17 | #include <iprt/fs.h>
|
---|
18 |
|
---|
19 |
|
---|
20 | /** @name VBOX_EXTPACK_DESCRIPTION_NAME
|
---|
21 | * The name of the description file in an extension pack. */
|
---|
22 | #define VBOX_EXTPACK_DESCRIPTION_NAME "ExtPack.xml"
|
---|
23 | /** @name VBOX_EXTPACK_SUFFIX
|
---|
24 | * The suffix of a extension pack tarball. */
|
---|
25 | #define VBOX_EXTPACK_SUFFIX ".vbox-extpack"
|
---|
26 |
|
---|
27 | /** The minimum length (strlen) of a extension pack name. */
|
---|
28 | #define VBOX_EXTPACK_NAME_MIN_LEN 6
|
---|
29 | /** The max length (strlen) of a extension pack name. */
|
---|
30 | #define VBOX_EXTPACK_NAME_MAX_LEN 64
|
---|
31 |
|
---|
32 | /** The architecture-dependent application data subdirectory where the
|
---|
33 | * extension packs are installed. Relative to RTPathAppPrivateArch. */
|
---|
34 | #define VBOX_EXTPACK_INSTALL_DIR "ExtensionPacks"
|
---|
35 | /** The architecture-independent application data subdirectory where the
|
---|
36 | * certificates are installed. Relative to RTPathAppPrivateNoArch. */
|
---|
37 | #define VBOX_EXTPACK_CERT_DIR "Certificates"
|
---|
38 |
|
---|
39 |
|
---|
40 | /**
|
---|
41 | * Description of an extension pack.
|
---|
42 | *
|
---|
43 | * This is the internal representation of the ExtPack.xml.
|
---|
44 | */
|
---|
45 | typedef struct VBOXEXTPACKDESC
|
---|
46 | {
|
---|
47 | /** The name. */
|
---|
48 | iprt::MiniString strName;
|
---|
49 | /** The description. */
|
---|
50 | iprt::MiniString strDescription;
|
---|
51 | /** The version string. */
|
---|
52 | iprt::MiniString strVersion;
|
---|
53 | /** The internal revision number. */
|
---|
54 | uint32_t uRevision;
|
---|
55 | /** The name of the main module. */
|
---|
56 | iprt::MiniString strMainModule;
|
---|
57 | } VBOXEXTPACKDESC;
|
---|
58 |
|
---|
59 | /** Pointer to a extension pack description. */
|
---|
60 | typedef VBOXEXTPACKDESC *PVBOXEXTPACKDESC;
|
---|
61 | /** Pointer to a const extension pack description. */
|
---|
62 | typedef VBOXEXTPACKDESC const *PCVBOXEXTPACKDESC;
|
---|
63 |
|
---|
64 |
|
---|
65 | iprt::MiniString *VBoxExtPackLoadDesc(const char *a_pszDir, PVBOXEXTPACKDESC a_pExtPackDesc, PRTFSOBJINFO a_pObjInfo);
|
---|
66 | iprt::MiniString *VBoxExtPackExtractNameFromTarballPath(const char *pszTarball);
|
---|
67 | bool VBoxExtPackIsValidName(const char *pszName);
|
---|
68 | bool VBoxExtPackIsValidVersionString(const char *pszName);
|
---|
69 | bool VBoxExtPackIsValidMainModuleString(const char *pszMainModule);
|
---|
70 |
|
---|
71 |
|
---|
72 | #endif
|
---|
73 |
|
---|