Files
Aerofoil/PortabilityLayer/PascalStr.h

42 lines
755 B
C
Raw Normal View History

2020-05-21 05:01:16 -04:00
#pragma once
2019-12-31 02:42:20 -05:00
#include "UnsafePascalStr.h"
2020-05-21 05:01:16 -04:00
class PLPasStr;
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);
2020-05-21 05:01:16 -04:00
explicit PascalStr(const PLPasStr &pstr);
};
}
2019-12-31 02:42:20 -05:00
#include <string.h>
2020-05-21 05:01:16 -04:00
#include "PLPasStr.h"
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)
{
}
template<size_t TSize>
PascalStr<TSize>::PascalStr(const PLPasStr &pstr)
: UnsafePascalStr<TSize, true>(pstr.Length(), pstr.Chars())
{
}
}