VirtualBox

source: vbox/trunk/src/VBox/Main/include/GuestCtrlImplPrivate.h@ 38210

Last change on this file since 38210 was 38210, checked in by vboxsync, 13 years ago

Main: Testcase for guest control output buffer parsing now is using the same code as GuestCtrlIO.

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
File size: 2.5 KB
Line 
1/** @file
2 *
3 * VirtualBox guest execution control private data definitions
4 */
5
6/*
7 * Copyright (C) 2011 Oracle Corporation
8 *
9 * This file is part of VirtualBox Open Source Edition (OSE), as
10 * available from http://www.virtualbox.org. This file is free software;
11 * you can redistribute it and/or modify it under the terms of the GNU
12 * General Public License (GPL) as published by the Free Software
13 * Foundation, in version 2 as it comes in the "COPYING" file of the
14 * VirtualBox OSE distribution. VirtualBox OSE is distributed in the
15 * hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
16 */
17
18#ifndef ____H_GUESTIMPLPRIVATE
19#define ____H_GUESTIMPLPRIVATE
20
21#include <VBox/com/com.h>
22#include <VBox/com/string.h>
23#include <VBox/com/VirtualBox.h>
24
25#include <map>
26#include <vector>
27
28using namespace com;
29
30#ifdef VBOX_WITH_GUEST_CONTROL
31# include <VBox/HostServices/GuestControlSvc.h>
32using namespace guestControl;
33#endif
34
35/** Structure representing the "value" side of a "key=value" pair. */
36typedef struct VBOXGUESTCTRL_STREAM_PAIR
37{
38 char *pszValue;
39} VBOXGUESTCTRL_STREAM_PAIR, *PVBOXGUESTCTRL_STREAM_PAIR;
40
41/** Map containing "key=value" pairs of a stream object. */
42typedef std::map< Utf8Str, VBOXGUESTCTRL_STREAM_PAIR > GuestCtrlStreamPairs;
43typedef std::map< Utf8Str, VBOXGUESTCTRL_STREAM_PAIR >::iterator GuestCtrlStreamPairsIter;
44typedef std::map< Utf8Str, VBOXGUESTCTRL_STREAM_PAIR >::const_iterator GuestCtrlStreamPairsIterConst;
45
46class GuestProcessStream
47{
48
49public:
50
51 GuestProcessStream();
52
53 virtual ~GuestProcessStream();
54
55public:
56
57 int AddData(const BYTE *pbData, size_t cbData);
58
59 void ClearPairs();
60
61 void Destroy();
62
63 int GetInt64Ex(const char *pszKey, int64_t *piVal);
64
65 int64_t GetInt64(const char *pszKey);
66
67 size_t GetNumPairs();
68
69 uint32_t GetOffset();
70
71 const char* GetString(const char *pszKey);
72
73 int GetUInt32Ex(const char *pszKey, uint32_t *puVal);
74
75 uint32_t GetUInt32(const char *pszKey);
76
77 int Parse();
78
79protected:
80
81 /** The map containing one more more stream pairs. */
82 GuestCtrlStreamPairs m_mapPairs;
83 /** Currently allocated size of internal stream buffer. */
84 uint32_t m_cbAllocated;
85 /** Currently used size of allocated internal stream buffer. */
86 uint32_t m_cbSize;
87 /** Current offset within the internal stream buffer. */
88 uint32_t m_cbOffset;
89 /** Current parser offset. */
90 uint32_t m_cbParserOffset;
91 /** Internal stream buffer. */
92 BYTE *m_pbBuffer;
93};
94#endif // ____H_GUESTIMPLPRIVATE
95
Note: See TracBrowser for help on using the repository browser.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette