4#ifndef _Stroika_Foundation_Characters_LineEndings_h_
5#define _Stroika_Foundation_Characters_LineEndings_h_ 1
7#include "Stroika/Foundation/StroikaPreComp.h"
12#include "Stroika/Foundation/Common/Common.h"
19 template <IPossibleCharacterRepresentation T>
20 static constexpr T
kEOL[] = {
21#if qStroika_Foundation_Common_Platform_Windows
23#elif qStroika_Foundation_Common_Platform_POSIX
30 template <
typename CHAR>
31 void AssureHasLineTermination (basic_string<CHAR>* text);
39 template <
typename TCHAR>
40 size_t CRLFToNL (
const TCHAR* srcText,
size_t srcTextBytes, TCHAR* outBuf,
size_t outBufSize);
41 template <
typename TCHAR>
42 void CRLFToNL (basic_string<TCHAR>* text);
43 template <
typename TCHAR>
44 basic_string<TCHAR>
CRLFToNL (
const basic_string<TCHAR>& text);
50 template <
typename TCHAR>
51 size_t NLToCRLF (
const TCHAR* srcText,
size_t srcTextBytes, TCHAR* outBuf,
size_t outBufSize);
52 template <
typename TCHAR>
53 basic_string<TCHAR>
NLToCRLF (
const basic_string<TCHAR>& text);
57 template <
typename TCHAR>
58 size_t NativeToNL (
const TCHAR* srcText,
size_t srcTextBytes, TCHAR* outBuf,
size_t outBufSize);
59 template <
typename TCHAR>
60 basic_string<TCHAR> NativeToNL (
const basic_string<TCHAR>& text);
64 template <
typename TCHAR>
65 size_t NLToNative (
const TCHAR* srcText,
size_t srcTextBytes, TCHAR* outBuf,
size_t outBufSize);
66 template <
typename TCHAR>
67 basic_string<TCHAR> NLToNative (
const basic_string<TCHAR>& text);
75 template <
typename TCHAR>
76 size_t NormalizeTextToNL (
const TCHAR* srcText,
size_t srcTextBytes, TCHAR* outBuf,
size_t outBufSize);
77 template <
typename TCHAR>
79 template <
typename TCHAR>
89#include "LineEndings.inl"
size_t NormalizeTextToNL(const TCHAR *srcText, size_t srcTextBytes, TCHAR *outBuf, size_t outBufSize)
size_t NLToCRLF(const TCHAR *srcText, size_t srcTextBytes, TCHAR *outBuf, size_t outBufSize)
Convert the argument srcText buffer from NL format line endings, to CRLF format line endings....
size_t CRLFToNL(const TCHAR *srcText, size_t srcTextBytes, TCHAR *outBuf, size_t outBufSize)
Convert the argument srcText buffer from CRLF format line endings, to NL format line endings.
static constexpr T kEOL[]
null-terminated String constant for current compiled platform - Windows (CRLF) or POSIX (NL) - macos ...