acme
Loading...
Searching...
No Matches
_const_string_range_impl.h
1//
2// _const_string_range_impl.h
3// acme
4//
5// Created by Camilo Sasuke Thomas Borregaard Sørensen on 2025-03-24.
6// Copyright © 2025 ca2 Software Development. All rights reserved.
7//
8#pragma once
9
10
11template < typename ITERATOR_TYPE >
12inline ::collection::count const_string_range < ITERATOR_TYPE > ::_count_parts_from_beginning(::collection::count cPathPartCountToConsume, CHARACTER chSeparator)
13{
14
15 ::collection::index i = 0;
16
17 for(; i < cPathPartCountToConsume; i++)
18 {
19
20 auto p = string_find_character(this->m_begin, chSeparator);
21
22 if(::is_null(p))
23 {
24
25 break;
26
27 }
28
29 this->m_begin = p + 1;
30
31 }
32
33 return i;
34
35}
36
37
38template < typename ITERATOR_TYPE >
39inline ::collection::count const_string_range < ITERATOR_TYPE > ::count_parts_from_beginning(::collection::count cPathPartCountToConsume, CHARACTER chSeparator)
40{
41
42 if(cPathPartCountToConsume <= 0)
43 {
44
45 return cPathPartCountToConsume;
46
47 }
48
49 return this->_count_parts_from_beginning(cPathPartCountToConsume, chSeparator);
50
51}