1 |
786 |
skrzyp |
// ####ECOSHOSTGPLCOPYRIGHTBEGIN####
|
2 |
|
|
// -------------------------------------------
|
3 |
|
|
// This file is part of the eCos host tools.
|
4 |
|
|
// Copyright (C) 1998, 1999, 2000 Free Software Foundation, Inc.
|
5 |
|
|
//
|
6 |
|
|
// This program is free software; you can redistribute it and/or modify
|
7 |
|
|
// it under the terms of the GNU General Public License as published by
|
8 |
|
|
// the Free Software Foundation; either version 2 or (at your option) any
|
9 |
|
|
// later version.
|
10 |
|
|
//
|
11 |
|
|
// This program is distributed in the hope that it will be useful, but
|
12 |
|
|
// WITHOUT ANY WARRANTY; without even the implied warranty of
|
13 |
|
|
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
14 |
|
|
// General Public License for more details.
|
15 |
|
|
//
|
16 |
|
|
// You should have received a copy of the GNU General Public License
|
17 |
|
|
// along with this program; if not, write to the
|
18 |
|
|
// Free Software Foundation, Inc., 51 Franklin Street,
|
19 |
|
|
// Fifth Floor, Boston, MA 02110-1301, USA.
|
20 |
|
|
// -------------------------------------------
|
21 |
|
|
// ####ECOSHOSTGPLCOPYRIGHTEND####
|
22 |
|
|
//=================================================================
|
23 |
|
|
//
|
24 |
|
|
// eCosTestPlatform.h
|
25 |
|
|
//
|
26 |
|
|
// platform information header
|
27 |
|
|
//
|
28 |
|
|
//=================================================================
|
29 |
|
|
//=================================================================
|
30 |
|
|
//#####DESCRIPTIONBEGIN####
|
31 |
|
|
//
|
32 |
|
|
// Author(s): sdf
|
33 |
|
|
// Contributors: sdf
|
34 |
|
|
// Date: 2000-04-01
|
35 |
|
|
// Description: eCosTestPlatform
|
36 |
|
|
// Usage:
|
37 |
|
|
//
|
38 |
|
|
//####DESCRIPTIONEND####
|
39 |
|
|
|
40 |
|
|
#ifndef _CeCosTestPlatform_H
|
41 |
|
|
#define _CeCosTestPlatform_H
|
42 |
|
|
|
43 |
|
|
#include "eCosStd.h"
|
44 |
|
|
#include "Collections.h"
|
45 |
|
|
#include "Properties.h"
|
46 |
|
|
#include <vector>
|
47 |
|
|
|
48 |
|
|
//=================================================================
|
49 |
|
|
// This class holds properties associated with a platform type (i.e. common to all instances of that platform)
|
50 |
|
|
// The information is read from a .eCosrc file or from the registry.
|
51 |
|
|
// An instance of a platform corresponds to the class CTestResource.
|
52 |
|
|
//=================================================================
|
53 |
|
|
|
54 |
|
|
class CeCosTestPlatform {
|
55 |
|
|
class CeCosTestPlatformProperties : public CProperties {
|
56 |
|
|
public:
|
57 |
|
|
CeCosTestPlatformProperties(CeCosTestPlatform *pti);
|
58 |
|
|
virtual ~CeCosTestPlatformProperties(){}
|
59 |
|
|
protected:
|
60 |
|
|
};
|
61 |
|
|
friend class CeCosTestPlatformProperties;
|
62 |
|
|
public:
|
63 |
|
|
|
64 |
|
|
static bool Load();
|
65 |
|
|
static bool Save();
|
66 |
|
|
|
67 |
|
|
bool IsValid() const { return NULL!=Get(m_strName); }
|
68 |
|
|
LPCTSTR Name() const { return m_strName.c_str(); }
|
69 |
|
|
LPCTSTR Prefix() const { return m_strPrefix.c_str(); }
|
70 |
|
|
LPCTSTR GdbCmds() const { return m_strCommands.c_str(); }
|
71 |
|
|
LPCTSTR Prompt() const { return m_strPrompt.c_str(); }
|
72 |
|
|
LPCTSTR Inferior()const { return m_strInferior.c_str(); }
|
73 |
|
|
bool ServerSideGdb() const { return 0!=m_nServerSideGdb; }
|
74 |
|
|
CeCosTestPlatform():m_nServerSideGdb(0){}
|
75 |
|
|
bool LoadFromCommandString(LPCTSTR psz);
|
76 |
|
|
CeCosTestPlatform(LPCTSTR pszIm,LPCTSTR pszPre,LPCTSTR pszPrompt,LPCTSTR pszGdb,bool bServerSideGdb,LPCTSTR pszInferior):
|
77 |
|
|
m_strName(pszIm),
|
78 |
|
|
m_strPrefix(pszPre),
|
79 |
|
|
m_strCommands(pszGdb),
|
80 |
|
|
m_strPrompt(pszPrompt),
|
81 |
|
|
m_nServerSideGdb(bServerSideGdb),
|
82 |
|
|
m_strInferior(pszInferior)
|
83 |
|
|
{}
|
84 |
|
|
static int Add (const CeCosTestPlatform &t);
|
85 |
|
|
|
86 |
|
|
static unsigned int Count() { return (unsigned)arPlatforms.size(); }
|
87 |
|
|
|
88 |
|
|
// Get a platform by name:
|
89 |
|
|
static const CeCosTestPlatform *Get(LPCTSTR t);
|
90 |
|
|
|
91 |
|
|
// This is only used to enumerate the available platforms:
|
92 |
|
|
static const CeCosTestPlatform *Get(unsigned int i) { return (i<Count())?&arPlatforms[i]:0; }
|
93 |
|
|
|
94 |
|
|
static void RemoveAllPlatforms();
|
95 |
|
|
|
96 |
|
|
static bool IsValid (LPCTSTR pszTarget) { return NULL!=Get(pszTarget); }
|
97 |
|
|
|
98 |
|
|
protected:
|
99 |
|
|
static bool LoadFromDir (LPCTSTR pszDir);
|
100 |
|
|
static bool SaveToDir (LPCTSTR pszDir);
|
101 |
|
|
#ifdef _WIN32
|
102 |
|
|
bool LoadFromRegistry(HKEY hKey,LPCTSTR pszKey);
|
103 |
|
|
static const String GetGreatestSubkey (LPCTSTR pszKey);
|
104 |
|
|
static bool SaveToRegistry(HKEY hKey,LPCTSTR pszKey);
|
105 |
|
|
#endif
|
106 |
|
|
String m_strName;
|
107 |
|
|
String m_strPrefix;
|
108 |
|
|
String m_strCommands;
|
109 |
|
|
String m_strPrompt;
|
110 |
|
|
int m_nServerSideGdb;
|
111 |
|
|
String m_strInferior;
|
112 |
|
|
static std::vector<CeCosTestPlatform> arPlatforms;
|
113 |
|
|
};
|
114 |
|
|
|
115 |
|
|
#endif
|