Files
Aerofoil/PortabilityLayer/PascalStr.h

42 lines
792 B
C
Raw Normal View History

2019-11-11 00:11:59 -05:00
#pragma once
2019-12-31 02:42:20 -05:00
#include "UnsafePascalStr.h"
class PLPasStr;
2019-11-11 00:11:59 -05:00
namespace PortabilityLayer
{
template<size_t TSize>
class PascalStr : public UnsafePascalStr<TSize, true>
{
public:
PascalStr();
2019-12-31 02:42:20 -05:00
PascalStr(size_t size, const char *str);
explicit PascalStr(const PLPasStr &pstr);
2019-11-11 00:11:59 -05:00
};
}
2019-12-31 02:42:20 -05:00
#include <string.h>
#include "PLPasStr.h"
2019-11-11 00:11:59 -05:00
namespace PortabilityLayer
{
template<size_t TSize>
inline PascalStr<TSize>::PascalStr()
: UnsafePascalStr<TSize, true>(0, nullptr)
{
}
template<size_t TSize>
PascalStr<TSize>::PascalStr(size_t size, const char *str)
: UnsafePascalStr<TSize, true>(size, str)
{
}
2019-12-31 02:42:20 -05:00
template<size_t TSize>
PascalStr<TSize>::PascalStr(const PLPasStr &pstr)
: UnsafePascalStr<TSize, true>(pstr.Length(), pstr.Chars())
{
}
}