Stroika Library 3.0d16
 
Loading...
Searching...
No Matches
LineBasedPartition.h
1/*
2 * Copyright(c) Sophist Solutions, Inc. 1990-2025. All rights reserved
3 */
4#ifndef _Stroika_Frameworks_Led_LineBasedPartition_h_
5#define _Stroika_Frameworks_Led_LineBasedPartition_h_ 1
6
7#include "Stroika/Frameworks/StroikaPreComp.h"
8
9#include "Stroika/Frameworks/Led/PartitioningTextImager.h"
10
11/*
12@MODULE: LineBasedPartition
13@DESCRIPTION:
14 <p>A LineBasedPartition is a concrete @'Partition' subclass in which the character '\n' is used to break
15 up the text into pieces (partition elements). This is the most basic, default, standard kind of Partition.</p>
16 */
17
18namespace Stroika::Frameworks::Led {
19
20 /**
21 * <p>Partition which implements the partitioning based on NL characters.</p>
22 * <p>As of Led 3.0, it is the only concrete partition supported, and its the overwhelmingly
23 * most likely one you would want to use. But - in some applications (notably LogoVista Translator Assistant) -
24 * it can be quite handy being able to override how this partitioning takes place.</p>
25 */
26 class LineBasedPartition : public Partition {
27 private:
28 using inherited = Partition;
29
30 public:
31 LineBasedPartition (TextStore& textStore);
32
33 protected:
34 enum SpecialHackToDisableInit {
35 eSpecialHackToDisableInit
36 };
37 LineBasedPartition (TextStore& textStore, SpecialHackToDisableInit hack);
38 virtual void FinalConstruct () override;
39
40 public:
41 virtual void UpdatePartitions (PartitionMarker* pm, const UpdateInfo& updateInfo) noexcept override;
42
43 protected:
44 virtual void CheckForSplits (PartitionMarker* pm, const UpdateInfo& updateInfo, size_t i) noexcept;
45 virtual bool NeedToCoalesce (PartitionMarker* pm) noexcept;
46
47#if qStroika_Foundation_Debug_AssertionsChecked
48 protected:
49 virtual void Invariant_ () const override;
50#endif
51 };
52
53}
54
55/*
56 ********************************************************************************
57 ***************************** Implementation Details ***************************
58 ********************************************************************************
59 */
60#include "LineBasedPartition.inl"
61
62#endif /*_Stroika_Frameworks_Led_LineBasedPartition_h_*/