edbee - Qt Editor Library v0.11.1
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
lineending.h
Go to the documentation of this file.
1// edbee - Copyright (c) 2012-2025 by Rick Blommers and contributors
2// SPDX-License-Identifier: MIT
3
4#pragma once
5
6#include "edbee/exports.h"
7
8namespace edbee {
9
10
13public:
14
21
22
23protected:
24
25 explicit LineEnding( LineEnding::Type ending, const char* chars, const char* escaped_chars, const char* name );
26 virtual ~LineEnding();
27
28public:
29 static LineEnding* types();
30 static int typeCount() { return TypeCount; }
31 static LineEnding* get( int idx );
32
33 static LineEnding* unixType();
34 static LineEnding* windowsType();
35 static LineEnding* macClassicType();
36
37
38 static LineEnding* detect( const QString& str, LineEnding* unkownEnding=0 );
39
40
42 virtual LineEnding::Type type() const { return type_; }
43
45 virtual const char* chars() const { return charsRef_; }
46
48 virtual const char* escapedChars() const { return escapedCharsRef_; }
49
51 virtual const char* name() const { return nameRef_; }
52
53
54 // virtual LineEnding detectLineEnding
55// virtual static QString lineEndingChars( LineEnding::Type endingType );
56
57private:
58
59 LineEnding::Type type_;
60 const char* charsRef_;
61 const char* escapedCharsRef_;
62 const char* nameRef_;
63};
64
65
66
67} // edbee
A special class to perform line-ending detection.
Definition lineending.h:12
virtual const char * chars() const
This method returns the chars.
Definition lineending.h:45
static int typeCount()
Definition lineending.h:30
virtual LineEnding::Type type() const
This method returns the type.
Definition lineending.h:42
virtual const char * name() const
This method returns the name of the line ending.
Definition lineending.h:51
virtual const char * escapedChars() const
This method returns the escaped chars.
Definition lineending.h:48
Type
Definition lineending.h:15
@ MacClassicType
Definition lineending.h:18
@ UnixType
Definition lineending.h:16
@ TypeCount
Definition lineending.h:19
@ WindowsType
Definition lineending.h:17
LineEnding(LineEnding::Type ending, const char *chars, const char *escaped_chars, const char *name)
Constructs a line ending type.
Definition lineending.cpp:59
#define EDBEE_EXPORT
Definition exports.h:15
QT Acessibility has an issue with reporting blank lines between elements lines. defining 'WINDOWS_EMP...
Definition commentcommand.cpp:20