inifile.hh (10385:3f943443ae30) inifile.hh (11168:f98eb2da15a4)
1/*
2 * Copyright (c) 2001-2005 The Regents of The University of Michigan
3 * All rights reserved.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions are
7 * met: redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer;

--- 21 unchanged lines hidden (view full) ---

30 */
31
32#ifndef __INIFILE_HH__
33#define __INIFILE_HH__
34
35#include <fstream>
36#include <list>
37#include <string>
1/*
2 * Copyright (c) 2001-2005 The Regents of The University of Michigan
3 * All rights reserved.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions are
7 * met: redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer;

--- 21 unchanged lines hidden (view full) ---

30 */
31
32#ifndef __INIFILE_HH__
33#define __INIFILE_HH__
34
35#include <fstream>
36#include <list>
37#include <string>
38#include <unordered_map>
38#include <vector>
39
39#include <vector>
40
40#include "base/hashmap.hh"
41
42/**
43 * @file
44 * Declaration of IniFile object.
45 * @todo Change comments to match documentation style.
46 */
47
48///
49/// This class represents the contents of a ".ini" file.

--- 39 unchanged lines hidden (view full) ---

89 };
90
91 ///
92 /// A section.
93 ///
94 class Section
95 {
96 /// EntryTable type. Map of strings to Entry object pointers.
41/**
42 * @file
43 * Declaration of IniFile object.
44 * @todo Change comments to match documentation style.
45 */
46
47///
48/// This class represents the contents of a ".ini" file.

--- 39 unchanged lines hidden (view full) ---

88 };
89
90 ///
91 /// A section.
92 ///
93 class Section
94 {
95 /// EntryTable type. Map of strings to Entry object pointers.
97 typedef m5::hash_map<std::string, Entry *> EntryTable;
96 typedef std::unordered_map<std::string, Entry *> EntryTable;
98
99 EntryTable table; ///< Table of entries.
100 mutable bool referenced; ///< Has this section been used?
101
102 public:
103 /// Constructor.
104 Section()
105 : table(), referenced(false)

--- 28 unchanged lines hidden (view full) ---

134 /// @retval True if any entries were printed.
135 bool printUnreferenced(const std::string &sectionName);
136
137 /// Print the contents of this section to cout (for debugging).
138 void dump(const std::string &sectionName);
139 };
140
141 /// SectionTable type. Map of strings to Section object pointers.
97
98 EntryTable table; ///< Table of entries.
99 mutable bool referenced; ///< Has this section been used?
100
101 public:
102 /// Constructor.
103 Section()
104 : table(), referenced(false)

--- 28 unchanged lines hidden (view full) ---

133 /// @retval True if any entries were printed.
134 bool printUnreferenced(const std::string &sectionName);
135
136 /// Print the contents of this section to cout (for debugging).
137 void dump(const std::string &sectionName);
138 };
139
140 /// SectionTable type. Map of strings to Section object pointers.
142 typedef m5::hash_map<std::string, Section *> SectionTable;
141 typedef std::unordered_map<std::string, Section *> SectionTable;
143
144 protected:
145 /// Hash of section names to Section object pointers.
146 SectionTable table;
147
148 /// Look up section with the given name, creating a new section if
149 /// not found.
150 /// @retval Pointer to section object.

--- 56 unchanged lines hidden ---
142
143 protected:
144 /// Hash of section names to Section object pointers.
145 SectionTable table;
146
147 /// Look up section with the given name, creating a new section if
148 /// not found.
149 /// @retval Pointer to section object.

--- 56 unchanged lines hidden ---