Panda3D
Loading...
Searching...
No Matches
nameUniquifier.h
Go to the documentation of this file.
1/**
2 * PANDA 3D SOFTWARE
3 * Copyright (c) Carnegie Mellon University. All rights reserved.
4 *
5 * All use of this software is subject to the terms of the revised BSD
6 * license. You should have received a copy of this license along
7 * with this source code in a file named "LICENSE."
8 *
9 * @file nameUniquifier.h
10 * @author drose
11 * @date 2000-02-16
12 */
13
14#ifndef NAMEUNIQUIFIER_H
15#define NAMEUNIQUIFIER_H
16
17#include "pandabase.h"
18
19#include <string>
20#include "pset.h"
21
22/**
23 * A handy class for converting a list of arbitrary names (strings) so that
24 * each name is guaranteed to be unique in the list. Useful for writing egg
25 * files with unique vertex pool names, or for file converters to file formats
26 * that require unique node names, etc.
27 */
28class EXPCL_PANDA_PUTIL NameUniquifier {
29public:
30 NameUniquifier(const std::string &separator = std::string(),
31 const std::string &empty = std::string());
33
34 INLINE std::string add_name(const std::string &name);
35 INLINE std::string add_name(const std::string &name, const std::string &prefix);
36
37private:
38 std::string add_name_body(const std::string &name, const std::string &prefix);
39
41 Names _names;
42 std::string _separator;
43 std::string _empty;
44 int _counter;
45};
46
47#include "nameUniquifier.I"
48
49#endif
A handy class for converting a list of arbitrary names (strings) so that each name is guaranteed to b...
This is our own Panda specialization on the default STL set.
Definition pset.h:49
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.