libzypp
12.16.5
Main Page
Related Pages
Modules
Namespaces
Classes
Files
File List
File Members
libzypp
Welcome to libzypp
Code Pitfalls - Frequently made mistakes
Code Snippets
Environment Variables
Testing for provided features.
Notes on revisions
Extending ZYpp: Plugins and Hooks
Services
Solver - Vendor protection
Writing and tunning testcases
Libzypp and threads
User data as transaction id
Todo List
Deprecated List
Modules
Namespaces
Classes
Files
File List
zypp
base
Algorithm.h
Backtrace.cc
Backtrace.h
Collector.h
Counter.h
Debug.h
DefaultIntegral.h
DtorReset.h
Easy.h
Errno.h
Exception.cc
Exception.h
ExternalDataSource.cc
ExternalDataSource.h
Fd.cc
Fd.h
Flags.h
Function.h
Functional.h
Gettext.cc
Gettext.h
GzStream.cc
GzStream.h
InputStream.cc
InputStream.h
InterProcessMutex.cc
InterProcessMutex.h
IOStream.cc
IOStream.h
Iterator.h
LogControl.cc
LogControl.h
Logger.h
LogTools.h
Measure.cc
Measure.h
NamedValue.h
NonCopyable.h
ProfilingFormater.cc
ProfilingFormater.h
ProvideNumericId.h
PtrTypes.h
Random.cc
Random.h
ReferenceCounted.cc
ReferenceCounted.h
Regex.cc
Regex.h
SafeBool.h
SerialNumber.cc
SerialNumber.h
Signal.h
String.cc
String.h
StrMatcher.cc
StrMatcher.h
Sysconfig.cc
Sysconfig.h
Tr1hash.h
Unit.cc
Unit.h
UserRequestException.cc
UserRequestException.h
WatchFile.h
media
misc
parser
pool
repo
sat
solver
target
thread
ui
url
ws
zypp_detail
APIConfig.h
Arch.cc
Arch.h
AutoDispose.h
Bit.h
ByteCount.cc
ByteCount.h
Callback.h
Capabilities.cc
Capabilities.h
Capability.cc
Capability.h
CapMatch.cc
CapMatch.h
Changelog.cc
Changelog.h
CheckSum.cc
CheckSum.h
CountryCode.cc
CountryCode.h
Date.cc
Date.h
Dep.cc
Dep.h
Digest.cc
Digest.h
DiskUsage.cc
DiskUsage.h
DiskUsageCounter.cc
DiskUsageCounter.h
DownloadMode.cc
DownloadMode.h
Edition.cc
Edition.h
ExternalProgram.cc
ExternalProgram.h
Fetcher.cc
Fetcher.h
FileChecker.cc
FileChecker.h
Filter.h
Glob.cc
Glob.h
HistoryLog.cc
HistoryLog.h
HistoryLogData.cc
HistoryLogData.h
IdString.cc
IdString.h
IdStringType.h
InstanceId.cc
InstanceId.h
KeyContext.h
KeyRing.cc
KeyRing.h
KVMap.h
LanguageCode.cc
LanguageCode.h
Locale.cc
Locale.h
Locks.cc
Locks.h
ManagedFile.h
MediaProducts.cc
MediaProducts.h
MediaSetAccess.cc
MediaSetAccess.h
Misc.h
OnMediaLocation.cc
OnMediaLocation.h
Package.cc
Package.h
PackageKeyword.h
Patch.cc
Patch.h
PathInfo.cc
PathInfo.h
Pathname.cc
Pathname.h
Pattern.cc
Pattern.h
PluginFrame.cc
PluginFrame.h
PluginFrameException.cc
PluginFrameException.h
PluginScript.cc
PluginScript.h
PluginScriptException.cc
PluginScriptException.h
PoolItem.cc
PoolItem.h
PoolItemBest.cc
PoolItemBest.h
PoolQuery.cc
PoolQuery.h
PoolQueryResult.cc
PoolQueryResult.h
PoolQueryUtil.tcc
ProblemSolution.cc
ProblemSolution.h
ProblemTypes.h
Product.cc
Product.h
ProgressData.cc
ProgressData.h
ProvideFilePolicy.cc
ProvideFilePolicy.h
PublicKey.cc
PublicKey.h
Range.cc
Range.h
Rel.cc
Rel.h
RelCompare.h
RepoInfo.cc
RepoInfo.h
RepoManager.cc
RepoManager.h
Repository.cc
Repository.h
RepoStatus.cc
RepoStatus.h
ResFilters.h
ResKind.cc
ResKind.h
ResObject.cc
ResObject.h
ResObjects.h
Resolvable.cc
Resolvable.h
Resolver.cc
Resolver.h
ResolverProblem.cc
ResolverProblem.h
ResPool.cc
ResPool.h
ResPoolProxy.cc
ResPoolProxy.h
ResStatus.cc
ResStatus.h
ResTraits.h
ServiceInfo.cc
ServiceInfo.h
Signature.cc
Signature.h
SrcPackage.cc
SrcPackage.h
SysContent.cc
SysContent.h
Target.cc
Target.h
TmpPath.cc
TmpPath.h
TriBool.h
Url.cc
Url.h
Vendor.h
VendorAttr.cc
VendorAttr.h
VendorSupportOptions.cc
VendorSupportOptions.h
ZConfig.cc
ZConfig.h
ZYpp.cc
ZYpp.h
ZYppCallbacks.h
ZYppCommit.h
ZYppCommitPolicy.cc
ZYppCommitPolicy.h
ZYppCommitResult.cc
ZYppCommitResult.h
ZYppFactory.cc
ZYppFactory.h
File Members
Regex.h
Go to the documentation of this file.
1
/*---------------------------------------------------------------------\
2
| ____ _ __ __ ___ |
3
| |__ / \ / / . \ . \ |
4
| / / \ V /| _/ _/ |
5
| / /__ | | | | | | |
6
| /_____||_| |_| |_| |
7
| |
8
\---------------------------------------------------------------------*/
12
#ifndef ZYPP_BASE_REGEX_H
13
#define ZYPP_BASE_REGEX_H
14
15
#include <iosfwd>
16
#include <string>
17
#include <regex.h>
18
19
#include "
zypp/base/Exception.h
"
20
22
namespace
zypp
23
{
27
namespace
str
28
{
53
54
typedef
Exception
regex_error
;
55
56
class
smatch
;
57
class
regex
;
58
67
bool
regex_match
(
const
char
* s,
smatch
& matches,
const
regex
&
regex
);
68
70
inline
bool
regex_match
(
const
std::string & s,
smatch
& matches,
const
regex
&
regex
)
71
{
return
regex_match
( s.c_str(), matches, regex ); }
72
74
bool
regex_match
(
const
char
* s,
const
regex & regex );
75
77
inline
bool
regex_match
(
const
std::string & s,
const
regex
&
regex
)
78
{
return
regex_match
( s.c_str(), regex ); }
79
86
class
regex
87
{
88
public
:
89
90
enum
RegFlags
{
91
optimize
= 0,
92
match_extra
= 0,
93
icase
= REG_ICASE,
94
nosubs
= REG_NOSUB,
95
match_extended
= REG_EXTENDED,
96
normal
= 1<<16
97
};
98
99
regex
();
100
regex
(
const
std::string& s,
int
flags =
match_extended
);
101
~regex
() throw();
102
103
regex
(const
regex
& rhs)
104
{
assign
(rhs.m_str, rhs.m_flags); }
105
106
regex
&
operator=
(
const
regex
& rhs)
107
{
assign
(rhs.
m_str
, rhs.
m_flags
);
return
*
this
; }
108
112
std::string
asString
()
const
113
{
return
m_str
; }
114
115
public
:
117
regex_t *
get
()
118
{
return
&
m_preg
; }
119
120
private
:
121
void
assign
(
const
std::string& s,
int
flags =
match_extended
);
122
123
private
:
124
friend
class
smatch
;
125
friend
bool
regex_match
(
const
char
* s,
str::smatch
& matches,
const
regex
&
regex
);
126
friend
bool
regex_match
(
const
char
* s,
const
regex
&
regex
);
127
std::string
m_str
;
128
int
m_flags
;
129
regex_t
m_preg
;
130
bool
m_valid
;
131
};
132
134
inline
std::ostream &
operator<<
( std::ostream & str,
const
regex
& obj )
135
{
return
str << obj.
asString
(); }
136
148
class
smatch
149
{
150
public
:
151
smatch
();
152
153
std::string
operator[]
(
unsigned
i)
const
;
154
155
unsigned
size
()
const
;
156
157
std::string
match_str
;
158
regmatch_t
pmatch
[12];
159
};
160
161
}
// namespace str
163
}
// namespace zypp
165
#endif // ZYPP_BASE_STRING_H
zypp
base
Regex.h
Generated by
1.8.2