1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
3 * This file is part of the LibreOffice project.
5 * This Source Code Form is subject to the terms of the Mozilla Public
6 * License, v. 2.0. If a copy of the MPL was not distributed with this
7 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
9 * This file incorporates work covered by the following license notice:
11 * Licensed to the Apache Software Foundation (ASF) under one or more
12 * contributor license agreements. See the NOTICE file distributed
13 * with this work for additional information regarding copyright
14 * ownership. The ASF licenses this file to you under the Apache
15 * License, Version 2.0 (the "License"); you may not use this file
16 * except in compliance with the License. You may obtain a copy of
17 * the License at http://www.apache.org/licenses/LICENSE-2.0 .
20 #ifndef CSV_DIRCHAIN_HXX
21 #define CSV_DIRCHAIN_HXX
27 #include <cosv/string.hxx>
29 #include <cosv/csv_ostream.hxx>
31 #include <cosv/persist.hxx>
32 #include <cosv/tpl/tpltools.hxx>
49 const DirectoryChain
&
54 DirectoryChain
& operator=(
55 const DirectoryChain
&
57 DirectoryChain
& operator+=(
58 const String
& i_sName
);
59 DirectoryChain
& operator+=(
60 const DirectoryChain
&
62 DirectoryChain
& operator-=(
68 bool i_bPathIsAlwaysDir
= false,
69 const char * i_sDelimiter
= Delimiter() );
71 const String
& i_sName
);
73 const DirectoryChain
&
81 StringVector::const_iterator
83 StringVector::const_iterator
86 const String
& Front() const;
87 const String
& Back() const;
91 const char * i_sDelimiter
) const;
99 DirectoryChain::DirectoryChain( const DirectoryChain
& i_rDC
)
103 inline DirectoryChain
&
104 DirectoryChain::operator=( const DirectoryChain
& i_rDC
)
105 { csv::erase_container(aPath
); PushBack(i_rDC
); return *this; }
106 inline DirectoryChain
&
107 DirectoryChain::operator+=( const String
& i_sName
)
108 { PushBack(i_sName
); return *this; }
109 inline DirectoryChain
&
110 DirectoryChain::operator+=( const DirectoryChain
& i_rDC
)
111 { PushBack(i_rDC
); return *this; }
112 inline DirectoryChain
&
113 DirectoryChain::operator-=( uintt i_nLevelsUp
)
114 { PopBack(i_nLevelsUp
); return *this; }
116 DirectoryChain::Size() const
117 { return aPath
.size(); }
119 inline StringVector::const_iterator
120 DirectoryChain::Begin() const
121 { return aPath
.begin(); }
122 inline StringVector::const_iterator
123 DirectoryChain::End() const
124 { return aPath
.end(); }
125 inline const String
&
126 DirectoryChain::Front() const
127 { return aPath
.empty() ? String::Null_() : aPath
.front(); }
128 inline const String
&
129 DirectoryChain::Back() const
130 { return aPath
.empty() ? String::Null_() : aPath
.back(); }
136 inline csv::bostream
&
137 operator<<( csv::bostream
& o_rOut
,
138 const csv::ploc::DirectoryChain
& i_rSubPath
)
140 i_rSubPath
.Get(o_rOut
, csv::ploc::Delimiter());
146 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */