libpromeki main
PROfessional MEdia toolKIt
 
Loading...
Searching...
No Matches
numnameseq.h
Go to the documentation of this file.
1
8#pragma once
9
11#include <promeki/core/list.h>
13
15
16class StringList;
17
27 public:
30
41
43 NumNameSeq() = default;
44
51 NumNameSeq(const NumName &n, size_t h, size_t t) :
52 _name(n), _head(h), _tail(t) {}
53
58 const NumName &name() const { return _name; }
59
64 bool isValid() const { return _name.isValid(); }
65
70 size_t length() const { return _tail - _head + 1; }
71
76 size_t head() const { return _head; }
77
82 size_t tail() const { return _tail; }
83
84 private:
85 NumName _name;
86 size_t _head = 0;
87 size_t _tail = 0;
88};
89
91
Dynamic array container wrapping std::vector.
Definition list.h:40
List()=default
Default constructor. Creates an empty list.
Describes a NumName sequence with a head and tail range.
Definition numnameseq.h:26
static List parseList(StringList &input)
Parses a list of NumNameSeq objects from the string list.
const NumName & name() const
Returns the NumName for this sequence.
Definition numnameseq.h:58
promeki::List< NumNameSeq > List
List of NumNameSeq values.
Definition numnameseq.h:29
NumNameSeq(const NumName &n, size_t h, size_t t)
Constructs a NumNameSeq with the given name, head, and tail.
Definition numnameseq.h:51
NumNameSeq()=default
Default constructor.
size_t length() const
Returns the number of entries in the sequence.
Definition numnameseq.h:70
size_t head() const
Returns the head (first) index of the sequence.
Definition numnameseq.h:76
bool isValid() const
Returns true if the sequence is valid.
Definition numnameseq.h:64
size_t tail() const
Returns the tail (last) index of the sequence.
Definition numnameseq.h:82
Deconstructs a numbered name into its prefix, number, and suffix components.
Definition numname.h:23
bool isValid() const
Checks whether this NumName contains a valid numeric field.
Definition numname.h:56
Manages a list of strings.
Definition stringlist.h:21
#define PROMEKI_NAMESPACE_BEGIN
Starts a promeki namespace block.
Definition namespace.h:14
#define PROMEKI_NAMESPACE_END
Ends a promeki namespace block.
Definition namespace.h:19