mirror of
https://github.com/ivellioscolin/pykd.git
synced 2025-04-21 04:13:22 +08:00
66 lines
1.8 KiB
C++
66 lines
1.8 KiB
C++
|
|
#pragma once
|
|
|
|
///////////////////////////////////////////////////////////////////////////////////
|
|
|
|
#include <string>
|
|
#include <vector>
|
|
|
|
///////////////////////////////////////////////////////////////////////////////////
|
|
|
|
namespace pykd {
|
|
|
|
///////////////////////////////////////////////////////////////////////////////////
|
|
|
|
class TypeInfo;
|
|
typedef boost::shared_ptr<TypeInfo> TypeInfoPtr;
|
|
|
|
///////////////////////////////////////////////////////////////////////////////////
|
|
|
|
namespace UdtUtils {
|
|
|
|
///////////////////////////////////////////////////////////////////////////////////
|
|
|
|
struct Field {
|
|
Field( ULONG offset, const std::string &name, TypeInfoPtr type )
|
|
: m_offset(offset), m_name(name), m_type(type)
|
|
{}
|
|
|
|
bool operator ==(const std::string &name) const {
|
|
return m_name == name;
|
|
}
|
|
|
|
ULONG m_offset;
|
|
std::string m_name;
|
|
TypeInfoPtr m_type;
|
|
};
|
|
|
|
///////////////////////////////////////////////////////////////////////////////////
|
|
|
|
class FieldCollection : public std::vector< Field > {
|
|
typedef std::vector< Field > Base;
|
|
public:
|
|
FieldCollection(const std::string &baseTypeName) : m_baseTypeName(baseTypeName)
|
|
{}
|
|
|
|
const Field &lookup(ULONG index) const;
|
|
const Field &lookup(const std::string &name) const;
|
|
|
|
private:
|
|
std::string m_baseTypeName;
|
|
};
|
|
|
|
///////////////////////////////////////////////////////////////////////////////////
|
|
|
|
ULONG getFiledOffsetRecirsive(TypeInfoPtr typeInfo, const std::string &fieldName);
|
|
|
|
///////////////////////////////////////////////////////////////////////////////////
|
|
|
|
} // namespace UdtUtils
|
|
|
|
///////////////////////////////////////////////////////////////////////////////////
|
|
|
|
} // namespace pykd
|
|
|
|
///////////////////////////////////////////////////////////////////////////////////
|