Author: mcalmer
Date: Sat Jul 3 13:27:18 2010
New Revision: 2675
URL: http://svn.opensuse.org/viewcvs/limal?rev=2675&view=rev
Log:
blocxx::String => std::string; add PosixRegEx
Added:
limal-branches/mc-devel/limal-ca-mgm/src/PosixRegEx.cpp
limal-branches/mc-devel/limal-ca-mgm/src/limal/PosixRegEx.hpp
Modified:
limal-branches/mc-devel/limal-ca-mgm/src/AuthorityInfoAccessExtension.cpp
limal-branches/mc-devel/limal-ca-mgm/src/AuthorityKeyIdentifierExtension.cpp
limal-branches/mc-devel/limal-ca-mgm/src/AuthorityKeyIdentifierExtension_Priv.cpp
limal-branches/mc-devel/limal-ca-mgm/src/AuthorityKeyIdentifierGenerateExtension.cpp
limal-branches/mc-devel/limal-ca-mgm/src/BasicConstraintsExtension.cpp
limal-branches/mc-devel/limal-ca-mgm/src/BitExtensions.cpp
limal-branches/mc-devel/limal-ca-mgm/src/ByteBuffer.cpp
limal-branches/mc-devel/limal-ca-mgm/src/CA.cpp
limal-branches/mc-devel/limal-ca-mgm/src/CAConfig.cpp
limal-branches/mc-devel/limal-ca-mgm/src/CRLData.cpp
limal-branches/mc-devel/limal-ca-mgm/src/CRLDataImpl.hpp
limal-branches/mc-devel/limal-ca-mgm/src/CRLData_Priv.cpp
limal-branches/mc-devel/limal-ca-mgm/src/CRLData_Priv.hpp
limal-branches/mc-devel/limal-ca-mgm/src/CRLDistributionPointsExtension.cpp
limal-branches/mc-devel/limal-ca-mgm/src/CRLGenerationData.cpp
limal-branches/mc-devel/limal-ca-mgm/src/CRLReason.cpp
limal-branches/mc-devel/limal-ca-mgm/src/CRLReason_Priv.cpp
limal-branches/mc-devel/limal-ca-mgm/src/CertificateData.cpp
limal-branches/mc-devel/limal-ca-mgm/src/CertificateDataImpl.hpp
limal-branches/mc-devel/limal-ca-mgm/src/CertificateData_Priv.cpp
limal-branches/mc-devel/limal-ca-mgm/src/CertificateData_Priv.hpp
limal-branches/mc-devel/limal-ca-mgm/src/CertificateIssueData.cpp
limal-branches/mc-devel/limal-ca-mgm/src/CertificatePoliciesExtension.cpp
limal-branches/mc-devel/limal-ca-mgm/src/Commands.hpp.in
limal-branches/mc-devel/limal-ca-mgm/src/DNObject.cpp
limal-branches/mc-devel/limal-ca-mgm/src/DNObjectImpl.hpp
limal-branches/mc-devel/limal-ca-mgm/src/DNObject_Priv.cpp
limal-branches/mc-devel/limal-ca-mgm/src/DNObject_Priv.hpp
limal-branches/mc-devel/limal-ca-mgm/src/Date.cpp
limal-branches/mc-devel/limal-ca-mgm/src/ExtendedKeyUsageExt.cpp
limal-branches/mc-devel/limal-ca-mgm/src/ExtensionBase.cpp
limal-branches/mc-devel/limal-ca-mgm/src/INIParser/INIParser.cpp
limal-branches/mc-devel/limal-ca-mgm/src/INIParser/INIParser.hpp
limal-branches/mc-devel/limal-ca-mgm/src/INIParser/INIParserDescr.hpp
limal-branches/mc-devel/limal-ca-mgm/src/INIParser/IniFile.cpp
limal-branches/mc-devel/limal-ca-mgm/src/INIParser/IniFile.h
limal-branches/mc-devel/limal-ca-mgm/src/INIParser/IniParser.cpp
limal-branches/mc-devel/limal-ca-mgm/src/INIParser/IniParser.h
limal-branches/mc-devel/limal-ca-mgm/src/IssuerAlternativeNameExtension.cpp
limal-branches/mc-devel/limal-ca-mgm/src/LDAPUrlImpl.cpp
limal-branches/mc-devel/limal-ca-mgm/src/LDAPUrlImpl.hpp
limal-branches/mc-devel/limal-ca-mgm/src/LiteralValues.cpp
limal-branches/mc-devel/limal-ca-mgm/src/LiteralValues_Priv.cpp
limal-branches/mc-devel/limal-ca-mgm/src/LocalManagement.cpp
limal-branches/mc-devel/limal-ca-mgm/src/Makefile.am
limal-branches/mc-devel/limal-ca-mgm/src/OpenSSLUtils.cpp
limal-branches/mc-devel/limal-ca-mgm/src/OpenSSLUtils.hpp
limal-branches/mc-devel/limal-ca-mgm/src/PathInfo.cpp
limal-branches/mc-devel/limal-ca-mgm/src/PathName.cpp
limal-branches/mc-devel/limal-ca-mgm/src/PathUtils.cpp
limal-branches/mc-devel/limal-ca-mgm/src/RequestData.cpp
limal-branches/mc-devel/limal-ca-mgm/src/RequestDataImpl.hpp
limal-branches/mc-devel/limal-ca-mgm/src/RequestData_Priv.cpp
limal-branches/mc-devel/limal-ca-mgm/src/RequestData_Priv.hpp
limal-branches/mc-devel/limal-ca-mgm/src/RequestGenerationData.cpp
limal-branches/mc-devel/limal-ca-mgm/src/String.cpp
limal-branches/mc-devel/limal-ca-mgm/src/StringExtensions.cpp
limal-branches/mc-devel/limal-ca-mgm/src/SubjectAlternativeNameExtension.cpp
limal-branches/mc-devel/limal-ca-mgm/src/SubjectKeyIdentifierExtension.cpp
limal-branches/mc-devel/limal-ca-mgm/src/Url.cpp
limal-branches/mc-devel/limal-ca-mgm/src/UrlBase.cpp
limal-branches/mc-devel/limal-ca-mgm/src/UrlByScheme.cpp
limal-branches/mc-devel/limal-ca-mgm/src/UrlByScheme.hpp
limal-branches/mc-devel/limal-ca-mgm/src/UrlUtils.cpp
limal-branches/mc-devel/limal-ca-mgm/src/Utils.cpp
limal-branches/mc-devel/limal-ca-mgm/src/Utils.hpp
limal-branches/mc-devel/limal-ca-mgm/src/ValueCheck.cpp
limal-branches/mc-devel/limal-ca-mgm/src/ValueIntCheck.cpp
limal-branches/mc-devel/limal-ca-mgm/src/ValuePerlRECheck.cpp
limal-branches/mc-devel/limal-ca-mgm/src/ValuePosixRECheck.cpp
limal-branches/mc-devel/limal-ca-mgm/src/X509v3CRLExtensions.cpp
limal-branches/mc-devel/limal-ca-mgm/src/X509v3CRLExtensions_Priv.cpp
limal-branches/mc-devel/limal-ca-mgm/src/X509v3CRLGenerationExtensions.cpp
limal-branches/mc-devel/limal-ca-mgm/src/X509v3CertificateExtensions.cpp
limal-branches/mc-devel/limal-ca-mgm/src/X509v3CertificateExtensionsImpl.hpp
limal-branches/mc-devel/limal-ca-mgm/src/X509v3CertificateExtensions_Priv.cpp
limal-branches/mc-devel/limal-ca-mgm/src/X509v3CertificateIssueExtensions.cpp
limal-branches/mc-devel/limal-ca-mgm/src/X509v3RequestExtensions.cpp
limal-branches/mc-devel/limal-ca-mgm/src/X509v3RequestExtensionsImpl.hpp
limal-branches/mc-devel/limal-ca-mgm/src/X509v3RequestExtensions_Priv.cpp
limal-branches/mc-devel/limal-ca-mgm/src/limal/Exception.hpp
limal-branches/mc-devel/limal-ca-mgm/src/limal/Makefile.am
limal-branches/mc-devel/limal-ca-mgm/src/limal/PathInfo.hpp
limal-branches/mc-devel/limal-ca-mgm/src/limal/PathName.hpp
limal-branches/mc-devel/limal-ca-mgm/src/limal/PathUtils.hpp
limal-branches/mc-devel/limal-ca-mgm/src/limal/String.hpp
limal-branches/mc-devel/limal-ca-mgm/src/limal/Url.hpp
limal-branches/mc-devel/limal-ca-mgm/src/limal/UrlBase.hpp
limal-branches/mc-devel/limal-ca-mgm/src/limal/UrlUtils.hpp
limal-branches/mc-devel/limal-ca-mgm/src/limal/ValueCheck.hpp
limal-branches/mc-devel/limal-ca-mgm/src/limal/ValueIntCheck.hpp
limal-branches/mc-devel/limal-ca-mgm/src/limal/ValuePerlRECheck.hpp
limal-branches/mc-devel/limal-ca-mgm/src/limal/ValuePosixRECheck.hpp
limal-branches/mc-devel/limal-ca-mgm/src/limal/ca-mgm/AuthorityInfoAccessExtension.hpp
limal-branches/mc-devel/limal-ca-mgm/src/limal/ca-mgm/AuthorityKeyIdentifierExtension.hpp
limal-branches/mc-devel/limal-ca-mgm/src/limal/ca-mgm/AuthorityKeyIdentifierGenerateExtension.hpp
limal-branches/mc-devel/limal-ca-mgm/src/limal/ca-mgm/BasicConstraintsExtension.hpp
limal-branches/mc-devel/limal-ca-mgm/src/limal/ca-mgm/BitExtensions.hpp
limal-branches/mc-devel/limal-ca-mgm/src/limal/ca-mgm/CA.hpp
limal-branches/mc-devel/limal-ca-mgm/src/limal/ca-mgm/CAConfig.hpp
limal-branches/mc-devel/limal-ca-mgm/src/limal/ca-mgm/CRLData.hpp
limal-branches/mc-devel/limal-ca-mgm/src/limal/ca-mgm/CRLDistributionPointsExtension.hpp
limal-branches/mc-devel/limal-ca-mgm/src/limal/ca-mgm/CRLGenerationData.hpp
limal-branches/mc-devel/limal-ca-mgm/src/limal/ca-mgm/CRLReason.hpp
limal-branches/mc-devel/limal-ca-mgm/src/limal/ca-mgm/CertificateData.hpp
limal-branches/mc-devel/limal-ca-mgm/src/limal/ca-mgm/CertificateIssueData.hpp
limal-branches/mc-devel/limal-ca-mgm/src/limal/ca-mgm/CertificatePoliciesExtension.hpp
limal-branches/mc-devel/limal-ca-mgm/src/limal/ca-mgm/CommonData.hpp
limal-branches/mc-devel/limal-ca-mgm/src/limal/ca-mgm/DNObject.hpp
limal-branches/mc-devel/limal-ca-mgm/src/limal/ca-mgm/ExtendedKeyUsageExt.hpp
limal-branches/mc-devel/limal-ca-mgm/src/limal/ca-mgm/ExtensionBase.hpp
limal-branches/mc-devel/limal-ca-mgm/src/limal/ca-mgm/IssuerAlternativeNameExtension.hpp
limal-branches/mc-devel/limal-ca-mgm/src/limal/ca-mgm/LiteralValues.hpp
limal-branches/mc-devel/limal-ca-mgm/src/limal/ca-mgm/LocalManagement.hpp
limal-branches/mc-devel/limal-ca-mgm/src/limal/ca-mgm/RequestData.hpp
limal-branches/mc-devel/limal-ca-mgm/src/limal/ca-mgm/RequestGenerationData.hpp
limal-branches/mc-devel/limal-ca-mgm/src/limal/ca-mgm/StringExtensions.hpp
limal-branches/mc-devel/limal-ca-mgm/src/limal/ca-mgm/SubjectAlternativeNameExtension.hpp
limal-branches/mc-devel/limal-ca-mgm/src/limal/ca-mgm/SubjectKeyIdentifierExtension.hpp
limal-branches/mc-devel/limal-ca-mgm/src/limal/ca-mgm/X509v3CRLExtensions.hpp
limal-branches/mc-devel/limal-ca-mgm/src/limal/ca-mgm/X509v3CRLGenerationExtensions.hpp
limal-branches/mc-devel/limal-ca-mgm/src/limal/ca-mgm/X509v3CertificateExtensions.hpp
limal-branches/mc-devel/limal-ca-mgm/src/limal/ca-mgm/X509v3CertificateIssueExtensions.hpp
limal-branches/mc-devel/limal-ca-mgm/src/limal/ca-mgm/X509v3RequestExtensions.hpp
limal-branches/mc-devel/limal-ca-mgm/testsuite/CA1.cc
limal-branches/mc-devel/limal-ca-mgm/testsuite/CA2.cc
limal-branches/mc-devel/limal-ca-mgm/testsuite/CA3.cc
limal-branches/mc-devel/limal-ca-mgm/testsuite/CA4.cc
limal-branches/mc-devel/limal-ca-mgm/testsuite/CA5.cc
limal-branches/mc-devel/limal-ca-mgm/testsuite/CA6.cc
limal-branches/mc-devel/limal-ca-mgm/testsuite/CA7.cc
limal-branches/mc-devel/limal-ca-mgm/testsuite/CA8.cc
limal-branches/mc-devel/limal-ca-mgm/testsuite/CA9.cc
limal-branches/mc-devel/limal-ca-mgm/testsuite/CAConfig.cc
limal-branches/mc-devel/limal-ca-mgm/testsuite/CRLTest.cc
limal-branches/mc-devel/limal-ca-mgm/testsuite/CertificateTest.cc
limal-branches/mc-devel/limal-ca-mgm/testsuite/CertificateTest2.cc
limal-branches/mc-devel/limal-ca-mgm/testsuite/CertificateTest3.cc
limal-branches/mc-devel/limal-ca-mgm/testsuite/CertificateTest4.cc
limal-branches/mc-devel/limal-ca-mgm/testsuite/CertificateTest5.cc
limal-branches/mc-devel/limal-ca-mgm/testsuite/CertificateTest6.cc
limal-branches/mc-devel/limal-ca-mgm/testsuite/ConvertTest.cc
limal-branches/mc-devel/limal-ca-mgm/testsuite/ExportTest.cc
limal-branches/mc-devel/limal-ca-mgm/testsuite/IPv6CheckTest.cc
limal-branches/mc-devel/limal-ca-mgm/testsuite/ImportCATest.cc
limal-branches/mc-devel/limal-ca-mgm/testsuite/ImportCommonCertificateTest.cc
limal-branches/mc-devel/limal-ca-mgm/testsuite/ImportRequestTest.cc
limal-branches/mc-devel/limal-ca-mgm/testsuite/ListCATreeTest.cc
limal-branches/mc-devel/limal-ca-mgm/testsuite/ListTest.cc
limal-branches/mc-devel/limal-ca-mgm/testsuite/ParseCATest.cc
limal-branches/mc-devel/limal-ca-mgm/testsuite/ParseCRLTest.cc
limal-branches/mc-devel/limal-ca-mgm/testsuite/ParseCertificateTest.cc
limal-branches/mc-devel/limal-ca-mgm/testsuite/ParseCertificateTest2.cc
limal-branches/mc-devel/limal-ca-mgm/testsuite/ParseRequestTest.cc
limal-branches/mc-devel/limal-ca-mgm/testsuite/RemoveCertificateTest.cc
limal-branches/mc-devel/limal-ca-mgm/testsuite/RemoveRequestTest.cc
limal-branches/mc-devel/limal-ca-mgm/testsuite/RequestTest.cc
limal-branches/mc-devel/limal-ca-mgm/testsuite/RevokeTest.cc
limal-branches/mc-devel/limal-ca-mgm/testsuite/RevokeTest2.cc
limal-branches/mc-devel/limal-ca-mgm/testsuite/RevokeTest3.cc
limal-branches/mc-devel/limal-ca-mgm/testsuite/RevokeTest4.cc
limal-branches/mc-devel/limal-ca-mgm/testsuite/RevokeTest5.cc
limal-branches/mc-devel/limal-ca-mgm/testsuite/SubCATest.cc
limal-branches/mc-devel/limal-ca-mgm/testsuite/TestRepos/Test_CA1/cam.txt
limal-branches/mc-devel/limal-ca-mgm/testsuite/TestRepos/Test_CA1/index.txt
limal-branches/mc-devel/limal-ca-mgm/testsuite/TestRepos/Test_CA1/serial
limal-branches/mc-devel/limal-ca-mgm/testsuite/TestRepos/Test_CA2/.rand
limal-branches/mc-devel/limal-ca-mgm/testsuite/TestRepos/Test_CA2/crl/crl.pem
limal-branches/mc-devel/limal-ca-mgm/testsuite/UpdateDBTest.cc
limal-branches/mc-devel/limal-ca-mgm/testsuite/VerifyTest.cc
limal-branches/mc-devel/limal-ca-mgm/testsuite/iniParser.cc
limal-branches/mc-devel/limal-ca-mgm/testsuite/sysConfig.cc
Modified: limal-branches/mc-devel/limal-ca-mgm/src/AuthorityInfoAccessExtension.cpp
URL: http://svn.opensuse.org/viewcvs/limal/limal-branches/mc-devel/limal-ca-mgm/src/AuthorityInfoAccessExtension.cpp?rev=2675&r1=2674&r2=2675&view=diff
==============================================================================
--- limal-branches/mc-devel/limal-ca-mgm/src/AuthorityInfoAccessExtension.cpp (original)
+++ limal-branches/mc-devel/limal-ca-mgm/src/AuthorityInfoAccessExtension.cpp Sat Jul 3 13:27:18 2010
@@ -41,10 +41,10 @@
public:
AuthorityInformationImpl()
- : accessOID(String()), location(LiteralValue())
+ : accessOID(std::string()), location(LiteralValue())
{}
- AuthorityInformationImpl(const String &accessOID_,
+ AuthorityInformationImpl(const std::string &accessOID_,
const LiteralValue& location_ )
: accessOID(accessOID_), location(location_)
{}
@@ -62,7 +62,7 @@
return new AuthorityInformationImpl(*this);
}
- String accessOID;
+ std::string accessOID;
LiteralValue location;
};
@@ -98,7 +98,7 @@
: m_impl(ai.m_impl)
{}
-AuthorityInformation::AuthorityInformation(const String &accessOID,
+AuthorityInformation::AuthorityInformation(const std::string &accessOID,
const LiteralValue& location)
: m_impl(new AuthorityInformationImpl(accessOID, location))
{
@@ -128,7 +128,7 @@
}
void
-AuthorityInformation::setAuthorityInformation(const String &accessOID,
+AuthorityInformation::setAuthorityInformation(const std::string &accessOID,
const LiteralValue& location)
{
if(!location.valid())
@@ -146,7 +146,7 @@
m_impl->location = location;
}
-blocxx::String
+std::string
AuthorityInformation::getAccessOID() const
{
return m_impl->accessOID;
@@ -177,14 +177,14 @@
return true;
}
-std::vectorblocxx::String
+std::vectorstd::string
AuthorityInformation::verify() const
{
- std::vectorblocxx::String result;
+ std::vectorstd::string result;
if(!initAccessOIDCheck().isValid(m_impl->accessOID))
{
- result.push_back(Format("invalid value(%1) for accessOID", m_impl->accessOID).toString());
+ result.push_back(str::form("invalid value(%s) for accessOID", m_impl->accessOID.c_str()));
}
appendArray(result, m_impl->location.verify());
@@ -192,10 +192,10 @@
return result;
}
-std::vectorblocxx::String
+std::vectorstd::string
AuthorityInformation::dump() const
{
- std::vectorblocxx::String result;
+ std::vectorstd::string result;
result.push_back("AuthorityInformation::dump()");
result.push_back("accessOID = " + getAccessOID());
@@ -254,23 +254,21 @@
type == E_CA_Req || type == E_CRL )
{
LOGIT_ERROR("wrong type" << type);
- BLOCXX_THROW(ca_mgm::ValueException, Format(__("Wrong type: %1."), type).c_str());
+ BLOCXX_THROW(ca_mgm::ValueException, str::form(__("Wrong type: %1."), type).c_str());
}
bool p = caConfig->exists(type2Section(type, true), "authorityInfoAccess");
if(p)
{
- std::vectorblocxx::String sp = convStringArray(
- PerlRegEx("\\s*,\\s*")
- .split(caConfig->getValue(type2Section(type, true), "authorityInfoAccess"))
- );
+ std::vectorstd::string sp = PerlRegEx("\\s*,\\s*")
+ .split(caConfig->getValue(type2Section(type, true), "authorityInfoAccess"));
- if(sp[0].equalsIgnoreCase("critical")) setCritical(true);
+ if(0 == str::compareCI(sp[0], "critical")) setCritical(true);
- std::vectorblocxx::String::const_iterator it = sp.begin();
+ std::vectorstd::string::const_iterator it = sp.begin();
for(; it != sp.end(); ++it)
{
- std::vectorblocxx::String al = convStringArray(PerlRegEx(";").split(*it));
+ std::vectorstd::string al = PerlRegEx(";").split(*it);
try
{
@@ -339,16 +337,16 @@
type == E_CA_Req || type == E_CRL )
{
LOGIT_ERROR("wrong type" << type);
- BLOCXX_THROW(ca_mgm::ValueException, Format(__("Wrong type: %1."), type).c_str());
+ BLOCXX_THROW(ca_mgm::ValueException, str::form(__("Wrong type: %1."), type).c_str());
}
if(isPresent())
{
- String extString;
+ std::string extString;
if(isCritical()) extString += "critical,";
- String val;
+ std::string val;
std::list<AuthorityInformation>::const_iterator it = m_impl->info.begin();
for(;it != m_impl->info.end(); ++it)
{
@@ -393,16 +391,16 @@
return true;
}
-std::vectorblocxx::String
+std::vectorstd::string
AuthorityInfoAccessExt::verify() const
{
- std::vectorblocxx::String result;
+ std::vectorstd::string result;
if(!isPresent()) return result;
if(m_impl->info.empty())
{
- result.push_back(String("No access informations available"));
+ result.push_back(std::string("No access informations available"));
}
std::list<AuthorityInformation>::const_iterator it = m_impl->info.begin();
for(;it != m_impl->info.end(); it++)
@@ -414,10 +412,10 @@
return result;
}
-std::vectorblocxx::String
+std::vectorstd::string
AuthorityInfoAccessExt::dump() const
{
- std::vectorblocxx::String result;
+ std::vectorstd::string result;
result.push_back("AuthorityInfoAccessExt::dump()");
appendArray(result, ExtensionBase::dump());
Modified: limal-branches/mc-devel/limal-ca-mgm/src/AuthorityKeyIdentifierExtension.cpp
URL: http://svn.opensuse.org/viewcvs/limal/limal-branches/mc-devel/limal-ca-mgm/src/AuthorityKeyIdentifierExtension.cpp?rev=2675&r1=2674&r2=2675&view=diff
==============================================================================
--- limal-branches/mc-devel/limal-ca-mgm/src/AuthorityKeyIdentifierExtension.cpp (original)
+++ limal-branches/mc-devel/limal-ca-mgm/src/AuthorityKeyIdentifierExtension.cpp Sat Jul 3 13:27:18 2010
@@ -36,9 +36,9 @@
public:
AuthorityKeyIdentifierExtImpl()
- : keyid(String())
- , DirName(String())
- , serial(String())
+ : keyid(std::string())
+ , DirName(std::string())
+ , serial(std::string())
{}
AuthorityKeyIdentifierExtImpl(const AuthorityKeyIdentifierExtImpl &impl)
@@ -55,9 +55,9 @@
return new AuthorityKeyIdentifierExtImpl(*this);
}
- String keyid;
- String DirName;
- String serial;
+ std::string keyid;
+ std::string DirName;
+ std::string serial;
};
// ======================================================================
@@ -86,7 +86,7 @@
return *this;
}
-blocxx::String
+std::string
AuthorityKeyIdentifierExt::getKeyID() const
{
if(!isPresent()) {
@@ -97,7 +97,7 @@
return m_impl->keyid;
}
-blocxx::String
+std::string
AuthorityKeyIdentifierExt::getDirName() const
{
if(!isPresent()) {
@@ -108,7 +108,7 @@
return m_impl->DirName;
}
-blocxx::String
+std::string
AuthorityKeyIdentifierExt::getSerial() const
{
if(!isPresent()) {
@@ -125,16 +125,16 @@
return true;
}
-std::vectorblocxx::String
+std::vectorstd::string
AuthorityKeyIdentifierExt::verify() const
{
- return std::vectorblocxx::String();
+ return std::vectorstd::string();
}
-std::vectorblocxx::String
+std::vectorstd::string
AuthorityKeyIdentifierExt::dump() const
{
- std::vectorblocxx::String result;
+ std::vectorstd::string result;
result.push_back("AuthorityKeyIdentifierExt::dump()");
appendArray(result, ExtensionBase::dump());
@@ -150,19 +150,19 @@
// protected
void
-AuthorityKeyIdentifierExt::setKeyID(const String& kid)
+AuthorityKeyIdentifierExt::setKeyID(const std::string& kid)
{
m_impl->keyid = kid;
}
void
-AuthorityKeyIdentifierExt::setDirName(const String& dirName)
+AuthorityKeyIdentifierExt::setDirName(const std::string& dirName)
{
m_impl->DirName = dirName;
}
void
-AuthorityKeyIdentifierExt::setSerial(const String& serial)
+AuthorityKeyIdentifierExt::setSerial(const std::string& serial)
{
m_impl->serial = serial;
}
Modified: limal-branches/mc-devel/limal-ca-mgm/src/AuthorityKeyIdentifierExtension_Priv.cpp
URL: http://svn.opensuse.org/viewcvs/limal/limal-branches/mc-devel/limal-ca-mgm/src/AuthorityKeyIdentifierExtension_Priv.cpp?rev=2675&r1=2674&r2=2675&view=diff
==============================================================================
--- limal-branches/mc-devel/limal-ca-mgm/src/AuthorityKeyIdentifierExtension_Priv.cpp (original)
+++ limal-branches/mc-devel/limal-ca-mgm/src/AuthorityKeyIdentifierExtension_Priv.cpp Sat Jul 3 13:27:18 2010
@@ -70,20 +70,17 @@
LOGIT_ERROR("Unable to parse the certificate (" << "Crit:" << crit << ")");
BLOCXX_THROW(ca_mgm::SyntaxException,
- Format("Unable to parse the certificate (Crit: %2)",
+ str::form("Unable to parse the certificate (Crit: %d)",
crit).c_str());
}
if(aki->keyid)
{
- String tmpKeyID;
+ std::string tmpKeyID;
for(int i = 0; i < aki->keyid->length; ++i)
{
- String d;
- d.format("%02x", aki->keyid->data[i]);
-
- tmpKeyID += d;
+ tmpKeyID += str::form( "%02x", aki->keyid->data[i]);
if( (i+1) < aki->keyid->length)
{
tmpKeyID += ":";
@@ -96,7 +93,7 @@
{
int j;
GENERAL_NAME *gen;
- String tmpDirName;
+ std::string tmpDirName;
for(j = 0; j < sk_GENERAL_NAME_num(aki->issuer); j++)
{
@@ -120,14 +117,11 @@
if(aki->serial)
{
- String tmpSerial;
+ std::string tmpSerial;
for(int i = 0; i < aki->serial->length; ++i)
{
- String d;
- d.format("%02x", aki->serial->data[i]);
-
- tmpSerial += d;
+ tmpSerial += str::form( "%02x", aki->serial->data[i]);
if( (i+1) < aki->serial->length)
{
tmpSerial += ":";
Modified: limal-branches/mc-devel/limal-ca-mgm/src/AuthorityKeyIdentifierGenerateExtension.cpp
URL: http://svn.opensuse.org/viewcvs/limal/limal-branches/mc-devel/limal-ca-mgm/src/AuthorityKeyIdentifierGenerateExtension.cpp?rev=2675&r1=2674&r2=2675&view=diff
==============================================================================
--- limal-branches/mc-devel/limal-ca-mgm/src/AuthorityKeyIdentifierGenerateExtension.cpp (original)
+++ limal-branches/mc-devel/limal-ca-mgm/src/AuthorityKeyIdentifierGenerateExtension.cpp Sat Jul 3 13:27:18 2010
@@ -81,27 +81,27 @@
{
LOGIT_ERROR("wrong type" << type);
BLOCXX_THROW(ca_mgm::ValueException,
- Format(__("Wrong type: %1."), type).c_str());
+ str::form(__("Wrong type: %1."), type).c_str());
}
bool p = caConfig->exists(type2Section(type, true), "authorityKeyIdentifier");
if(p)
{
- std::vectorblocxx::String sp = convStringArray(PerlRegEx("\\s*,\\s*")
- .split(caConfig->getValue(type2Section(type, true), "authorityKeyIdentifier")));
- if(sp[0].equalsIgnoreCase("critical"))
+ std::vectorstd::string sp = PerlRegEx("\\s*,\\s*")
+ .split(caConfig->getValue(type2Section(type, true), "authorityKeyIdentifier"));
+ if(0 == str::compareCI(sp[0], "critical"))
{
setCritical(true);
sp.erase(sp.begin());
}
- std::vectorblocxx::String::const_iterator it = sp.begin();
+ std::vectorstd::string::const_iterator it = sp.begin();
for(; it != sp.end(); ++it)
{
- if((*it).equalsIgnoreCase("keyid")) m_impl->keyid = KeyID_normal;
- else if((*it).equalsIgnoreCase("keyid:always")) m_impl->keyid = KeyID_always;
- else if((*it).equalsIgnoreCase("issuer")) m_impl->issuer = Issuer_normal;
- else if((*it).equalsIgnoreCase("issuer:always")) m_impl->issuer = Issuer_always;
+ if(0 == str::compareCI(*it, "keyid")) m_impl->keyid = KeyID_normal;
+ else if(0 == str::compareCI(*it, "keyid:always")) m_impl->keyid = KeyID_always;
+ else if(0 == str::compareCI(*it, "issuer")) m_impl->issuer = Issuer_normal;
+ else if(0 == str::compareCI(*it, "issuer:always")) m_impl->issuer = Issuer_always;
}
}
setPresent(p);
@@ -188,12 +188,12 @@
{
LOGIT_ERROR("wrong type" << type);
BLOCXX_THROW(ca_mgm::ValueException,
- Format(__("Wrong type: %1."), type).c_str());
+ str::form(__("Wrong type: %1."), type).c_str());
}
if(isPresent())
{
- String extString;
+ std::string extString;
if(isCritical()) extString += "critical,";
@@ -247,32 +247,32 @@
return true;
}
-std::vectorblocxx::String
+std::vectorstd::string
AuthorityKeyIdentifierGenerateExt::verify() const
{
- std::vectorblocxx::String result;
+ std::vectorstd::string result;
if(!isPresent()) return result;
if(getKeyID() == KeyID_none && getIssuer() == Issuer_none)
{
- result.push_back(String("Invalid value for keyid and issuer. ") +
- String("At least one of both must be set"));
+ result.push_back(std::string("Invalid value for keyid and issuer. ") +
+ std::string("At least one of both must be set"));
}
LOGIT_DEBUG_STRINGARRAY("AuthorityKeyIdentifierGenerateExt::verify()", result);
return result;
}
-std::vectorblocxx::String
+std::vectorstd::string
AuthorityKeyIdentifierGenerateExt::dump() const
{
- std::vectorblocxx::String result;
+ std::vectorstd::string result;
result.push_back("AuthorityKeyIdentifierGenerateExt::dump()");
appendArray(result, ExtensionBase::dump());
if(!isPresent()) return result;
- result.push_back("KeyID = " + String(getKeyID()));
- result.push_back("Issuer = " + String(getIssuer()));
+ result.push_back("KeyID = " + str::numstring(getKeyID()));
+ result.push_back("Issuer = " + str::numstring(getIssuer()));
return result;
}
Modified: limal-branches/mc-devel/limal-ca-mgm/src/BasicConstraintsExtension.cpp
URL: http://svn.opensuse.org/viewcvs/limal/limal-branches/mc-devel/limal-ca-mgm/src/BasicConstraintsExtension.cpp?rev=2675&r1=2674&r2=2675&view=diff
==============================================================================
--- limal-branches/mc-devel/limal-ca-mgm/src/BasicConstraintsExtension.cpp (original)
+++ limal-branches/mc-devel/limal-ca-mgm/src/BasicConstraintsExtension.cpp Sat Jul 3 13:27:18 2010
@@ -79,7 +79,7 @@
{
LOGIT_ERROR("wrong type" << type);
BLOCXX_THROW(ca_mgm::ValueException,
- Format(__("Wrong type: %1."), type).c_str());
+ str::form(__("Wrong type: %1."), type).c_str());
}
bool p = caConfig->exists(type2Section(type, true), "basicConstraints");
@@ -88,19 +88,19 @@
bool isCA = false;
int32_t pl = -1;
- std::vectorblocxx::String sp = convStringArray(PerlRegEx("\\s*,\\s*")
- .split(caConfig->getValue(type2Section(type, true), "basicConstraints")));
- if(sp[0].equalsIgnoreCase("critical")) setCritical(true);
+ std::vectorstd::string sp = PerlRegEx("\\s*,\\s*")
+ .split(caConfig->getValue(type2Section(type, true), "basicConstraints"));
+ if(0 == str::compareCI(sp[0], "critical")) setCritical(true);
- std::vectorblocxx::String::const_iterator it = sp.begin();
+ std::vectorstd::string::const_iterator it = sp.begin();
for(; it != sp.end(); ++it)
{
- if((*it).equalsIgnoreCase("ca:true")) isCA = true;
- else if((*it).equalsIgnoreCase("ca:false")) isCA = false;
- else if((*it).startsWith("pathlen:", String::E_CASE_INSENSITIVE))
+ if(0 == str::compareCI(*it, "ca:true")) isCA = true;
+ else if(0 == str::compareCI(*it, "ca:false")) isCA = false;
+ else if(0 == str::startsWithCI(*it, "pathlen:"))
{
- std::vectorblocxx::String plA = convStringArray(PerlRegEx(":").split(*it));
- pl = plA[1].toInt32();
+ std::vectorstd::string plA = PerlRegEx(":").split(*it);
+ pl = str::strtonum(plA[1]);
}
}
setBasicConstraints(isCA, pl);
@@ -182,12 +182,12 @@
{
LOGIT_ERROR("wrong type" << type);
BLOCXX_THROW(ca_mgm::ValueException,
- Format(__("Wrong type: %1."), type).c_str());
+ str::form(__("Wrong type: %1."), type).c_str());
}
if(isPresent())
{
- String basicConstraintsString;
+ std::string basicConstraintsString;
if(isCritical()) basicConstraintsString += "critical,";
@@ -196,7 +196,7 @@
basicConstraintsString += "CA:TRUE";
if(getPathLength() > -1)
{
- basicConstraintsString += ",pathlen:"+String(getPathLength());
+ basicConstraintsString += ",pathlen:"+str::numstring(getPathLength());
}
}
else
@@ -234,38 +234,38 @@
return true;
}
-std::vectorblocxx::String
+std::vectorstd::string
BasicConstraintsExt::verify() const
{
- std::vectorblocxx::String result;
+ std::vectorstd::string result;
if(!isPresent()) return result;
if(isCA() && getPathLength() < -1)
{
- result.push_back(Format("invalid value for pathLength(%1). Has to be >= -1",
- getPathLength()).toString());
+ result.push_back(str::form("invalid value for pathLength(%d). Has to be >= -1",
+ getPathLength()));
}
if(!isCA() && getPathLength() != -1)
{
- result.push_back(Format("invalid value for pathLength(%1). Has to be -1",
- getPathLength()).toString());
+ result.push_back(str::form("invalid value for pathLength(%d). Has to be -1",
+ getPathLength()));
}
LOGIT_DEBUG_STRINGARRAY("BasicConstraintsExt::verify()", result);
return result;
}
-std::vectorblocxx::String
+std::vectorstd::string
BasicConstraintsExt::dump() const
{
- std::vectorblocxx::String result;
+ std::vectorstd::string result;
result.push_back("BasicConstraintsExt::dump()");
appendArray(result, ExtensionBase::dump());
if(!isPresent()) return result;
- result.push_back("CA = " + Bool(isCA()).toString());
- result.push_back("pathlen = " + String(getPathLength()));
+ result.push_back("CA = " + str::toString(isCA()));
+ result.push_back("pathlen = " + str::numstring(getPathLength()));
return result;
}
Modified: limal-branches/mc-devel/limal-ca-mgm/src/BitExtensions.cpp
URL: http://svn.opensuse.org/viewcvs/limal/limal-branches/mc-devel/limal-ca-mgm/src/BitExtensions.cpp?rev=2675&r1=2674&r2=2675&view=diff
==============================================================================
--- limal-branches/mc-devel/limal-ca-mgm/src/BitExtensions.cpp (original)
+++ limal-branches/mc-devel/limal-ca-mgm/src/BitExtensions.cpp Sat Jul 3 13:27:18 2010
@@ -129,7 +129,7 @@
{
LOGIT_ERROR("wrong type" << type);
BLOCXX_THROW(ca_mgm::ValueException,
- Format(__("Wrong type: %1."), type).c_str());
+ str::form(__("Wrong type: %1."), type).c_str());
}
bool p = caConfig->exists(type2Section(type, true), "keyUsage");
@@ -137,23 +137,23 @@
{
uint32_t keyUsage = 0;
- String ku = caConfig->getValue(type2Section(type, true), "keyUsage");
- std::vectorblocxx::String sp = convStringArray(PerlRegEx("\\s*,\\s*").split(ku));
+ std::string ku = caConfig->getValue(type2Section(type, true), "keyUsage");
+ std::vectorstd::string sp = PerlRegEx("\\s*,\\s*").split(ku);
- if(sp[0].equalsIgnoreCase("critical")) setCritical(true);
+ if(0 == str::compareCI(sp[0], "critical")) setCritical(true);
- std::vectorblocxx::String::const_iterator it = sp.begin();
+ std::vectorstd::string::const_iterator it = sp.begin();
for(; it != sp.end(); ++it)
{
- if((*it).equalsIgnoreCase("digitalSignature")) keyUsage |= digitalSignature;
- else if((*it).equalsIgnoreCase("nonRepudiation")) keyUsage |= nonRepudiation;
- else if((*it).equalsIgnoreCase("keyEncipherment")) keyUsage |= keyEncipherment;
- else if((*it).equalsIgnoreCase("dataEncipherment")) keyUsage |= dataEncipherment;
- else if((*it).equalsIgnoreCase("keyAgreement")) keyUsage |= keyAgreement;
- else if((*it).equalsIgnoreCase("keyCertSign")) keyUsage |= keyCertSign;
- else if((*it).equalsIgnoreCase("cRLSign")) keyUsage |= cRLSign;
- else if((*it).equalsIgnoreCase("encipherOnly")) keyUsage |= encipherOnly;
- else if((*it).equalsIgnoreCase("decipherOnly")) keyUsage |= decipherOnly;
+ if(0 == str::compareCI(*it, "digitalSignature")) keyUsage |= digitalSignature;
+ else if(0 == str::compareCI(*it, "nonRepudiation")) keyUsage |= nonRepudiation;
+ else if(0 == str::compareCI(*it, "keyEncipherment")) keyUsage |= keyEncipherment;
+ else if(0 == str::compareCI(*it, "dataEncipherment")) keyUsage |= dataEncipherment;
+ else if(0 == str::compareCI(*it, "keyAgreement")) keyUsage |= keyAgreement;
+ else if(0 == str::compareCI(*it, "keyCertSign")) keyUsage |= keyCertSign;
+ else if(0 == str::compareCI(*it, "cRLSign")) keyUsage |= cRLSign;
+ else if(0 == str::compareCI(*it, "encipherOnly")) keyUsage |= encipherOnly;
+ else if(0 == str::compareCI(*it, "decipherOnly")) keyUsage |= decipherOnly;
else
LOGIT_INFO("Unknown KeyUsage option: " << (*it));
@@ -242,12 +242,12 @@
{
LOGIT_ERROR("wrong type" << type);
BLOCXX_THROW(ca_mgm::ValueException,
- Format(__("Wrong type: %1."), type).c_str());
+ str::form(__("Wrong type: %1."), type).c_str());
}
if(isPresent())
{
- String keyUsageString;
+ std::string keyUsageString;
if(isCritical()) keyUsageString += "critical,";
@@ -307,34 +307,32 @@
return true;
}
-std::vectorblocxx::String
+std::vectorstd::string
KeyUsageExt::verify() const
{
- std::vectorblocxx::String result;
+ std::vectorstd::string result;
if(!isPresent()) return result;
if(!validKeyUsage(getValue()))
{
- result.push_back(Format("invalid value '%1' for keyUsage", getValue()).toString());
+ result.push_back(str::form("invalid value '%d' for keyUsage", getValue()));
}
LOGIT_DEBUG_STRINGARRAY("KeyUsageExt::verify()", result);
return result;
}
-std::vectorblocxx::String
+std::vectorstd::string
KeyUsageExt::dump() const
{
- std::vectorblocxx::String result;
+ std::vectorstd::string result;
result.push_back("KeyUsageExt::dump()");
appendArray(result, ExtensionBase::dump());
if(!isPresent()) return result;
- String ku;
- ku.format("%04x", getValue());
- result.push_back("KeyUsage = 0x" + ku);
+ result.push_back("KeyUsage = " + str::hexstring(getValue(), 4));
return result;
}
@@ -369,7 +367,7 @@
{
LOGIT_ERROR("wrong type" << type);
BLOCXX_THROW(ca_mgm::ValueException,
- Format(__("Wrong type: %1."), type).c_str());
+ str::form(__("Wrong type: %1."), type).c_str());
}
bool p = caConfig->exists(type2Section(type, true), "nsCertType");
@@ -377,22 +375,22 @@
{
uint32_t bits = 0;
- String ct = caConfig->getValue(type2Section(type, true), "nsCertType");
- std::vectorblocxx::String sp = convStringArray(PerlRegEx("\\s*,\\s*").split(ct));
+ std::string ct = caConfig->getValue(type2Section(type, true), "nsCertType");
+ std::vectorstd::string sp = PerlRegEx("\\s*,\\s*").split(ct);
- if(sp[0].equalsIgnoreCase("critical")) setCritical(true);
+ if(0 == str::compareCI(sp[0], "critical")) setCritical(true);
- std::vectorblocxx::String::const_iterator it = sp.begin();
+ std::vectorstd::string::const_iterator it = sp.begin();
for(; it != sp.end(); ++it)
{
- if((*it).equalsIgnoreCase("client")) bits |= client;
- else if((*it).equalsIgnoreCase("server")) bits |= server;
- else if((*it).equalsIgnoreCase("email")) bits |= email;
- else if((*it).equalsIgnoreCase("objsign")) bits |= objsign;
- else if((*it).equalsIgnoreCase("reserved")) bits |= reserved;
- else if((*it).equalsIgnoreCase("sslCA")) bits |= sslCA;
- else if((*it).equalsIgnoreCase("emailCA")) bits |= emailCA;
- else if((*it).equalsIgnoreCase("objCA")) bits |= objCA;
+ if(0 == str::compareCI(*it, "client")) bits |= client;
+ else if(0 == str::compareCI(*it, "server")) bits |= server;
+ else if(0 == str::compareCI(*it, "email")) bits |= email;
+ else if(0 == str::compareCI(*it, "objsign")) bits |= objsign;
+ else if(0 == str::compareCI(*it, "reserved")) bits |= reserved;
+ else if(0 == str::compareCI(*it, "sslCA")) bits |= sslCA;
+ else if(0 == str::compareCI(*it, "emailCA")) bits |= emailCA;
+ else if(0 == str::compareCI(*it, "objCA")) bits |= objCA;
else
LOGIT_INFO("Unknown NsCertType option: " << (*it));
}
@@ -436,7 +434,7 @@
if(nsCertTypes > 0xFF || nsCertTypes == 0)
{
BLOCXX_THROW(ca_mgm::ValueException,
- Format(__("Invalid value for NsCertTypeExt: %1."), nsCertTypes).c_str());
+ str::form(__("Invalid value for NsCertTypeExt: %1."), nsCertTypes).c_str());
}
setValue(nsCertTypes);
setPresent(true);
@@ -477,12 +475,12 @@
{
LOGIT_ERROR("wrong type" << type);
BLOCXX_THROW(ca_mgm::ValueException,
- Format(__("Wrong type: %1."), type).c_str());
+ str::form(__("Wrong type: %1."), type).c_str());
}
if(isPresent())
{
- String nsCertTypeString;
+ std::string nsCertTypeString;
if(isCritical()) nsCertTypeString += "critical,";
@@ -538,33 +536,31 @@
return true;
}
-std::vectorblocxx::String
+std::vectorstd::string
NsCertTypeExt::verify() const
{
- std::vectorblocxx::String result;
+ std::vectorstd::string result;
if(!isPresent()) return result;
if(getValue() > 0xFF || getValue() == 0)
{
- result.push_back(Format("invalid value '%1' for nsCertType", getValue()).toString());
+ result.push_back(str::form("invalid value '%d' for nsCertType", getValue()));
}
LOGIT_DEBUG_STRINGARRAY("NsCertTypeExt::verify()", result);
return result;
}
-std::vectorblocxx::String
+std::vectorstd::string
NsCertTypeExt::dump() const
{
- std::vectorblocxx::String result;
+ std::vectorstd::string result;
result.push_back("NsCertTypeExt::dump()");
appendArray(result, ExtensionBase::dump());
if(!isPresent()) return result;
- String nsct;
- nsct.format("%02x", getValue());
- result.push_back("NsCertType = 0x" + nsct);
+ result.push_back("NsCertType = " + str::hexstring( getValue(), 4));
return result;
}
Modified: limal-branches/mc-devel/limal-ca-mgm/src/ByteBuffer.cpp
URL: http://svn.opensuse.org/viewcvs/limal/limal-branches/mc-devel/limal-ca-mgm/src/ByteBuffer.cpp?rev=2675&r1=2674&r2=2675&view=diff
==============================================================================
--- limal-branches/mc-devel/limal-ca-mgm/src/ByteBuffer.cpp (original)
+++ limal-branches/mc-devel/limal-ca-mgm/src/ByteBuffer.cpp Sat Jul 3 13:27:18 2010
@@ -19,8 +19,7 @@
#include
-#include
-#include
+#include
#include
#include <cstring>
@@ -244,7 +243,7 @@
LOGIT_ERROR("ByteBuffer index out of bounds: size="
<< size() << ", pos=" << pos);
- BLOCXX_THROW(blocxx::OutOfBoundsException, Format(
+ BLOCXX_THROW(blocxx::OutOfBoundsException, str::form(
__("ByteBuffer index out of bounds: size=%1, pos=%2."),
size(), pos).c_str());
}
@@ -294,7 +293,7 @@
LOGIT_ERROR("ByteBuffer index out of bounds: size="
<< size() << ", pos=" << pos);
- BLOCXX_THROW(blocxx::OutOfBoundsException, Format(
+ BLOCXX_THROW(blocxx::OutOfBoundsException, str::form(
__("ByteBuffer index out of bounds: size=%1, pos=%2."),
size(), pos).c_str());
}
@@ -311,7 +310,7 @@
LOGIT_ERROR("ByteBuffer index out of bounds: size="
<< size() << ", pos=" << pos);
- BLOCXX_THROW(blocxx::OutOfBoundsException, Format(
+ BLOCXX_THROW(blocxx::OutOfBoundsException, str::form(
__("ByteBuffer index out of bounds: size=%1, pos=%2."),
size(), pos).c_str());
}
@@ -441,24 +440,24 @@
std::ostream &
operator<<(std::ostream &out, const ByteBuffer &buf)
{
- if(buf.size() > 0)
- {
- const char *x = buf.data();
- blocxx::String s;
- for(size_t i = 0; i < buf.size(); ++i)
- {
- s.format("0x%02x ", x[i]);
- out << s;
- if( ((i + 1) % 16) == 0)
- out << std::endl;
- }
- }
- else
- {
- out << "No data";
- }
+ if(buf.size() > 0)
+ {
+ const char *x = buf.data();
+ std::string s;
+ for(size_t i = 0; i < buf.size(); ++i)
+ {
+ s = str::form("0x%02x ", x[i]);
+ out << s;
+ if( ((i + 1) % 16) == 0)
+ out << std::endl;
+ }
+ }
+ else
+ {
+ out << "No data";
+ }
- return out;
+ return out;
}
Modified: limal-branches/mc-devel/limal-ca-mgm/src/CA.cpp
URL: http://svn.opensuse.org/viewcvs/limal/limal-branches/mc-devel/limal-ca-mgm/src/CA.cpp?rev=2675&r1=2674&r2=2675&view=diff
==============================================================================
--- limal-branches/mc-devel/limal-ca-mgm/src/CA.cpp (original)
+++ limal-branches/mc-devel/limal-ca-mgm/src/CA.cpp Sat Jul 3 13:27:18 2010
@@ -52,7 +52,7 @@
{
public:
- CAImpl(const String& caName, const String& caPasswd, const String& repos)
+ CAImpl(const std::string& caName, const std::string& caPasswd, const std::string& repos)
: caName(caName)
, caPasswd(caPasswd)
, repositoryDir(repos)
@@ -80,7 +80,7 @@
return new CAImpl(*this);
}
- String
+ std::string
initConfigFile()
{
if(templ)
@@ -102,9 +102,9 @@
return "";
}
- String caName;
- String caPasswd;
- String repositoryDir;
+ std::string caName;
+ std::string caPasswd;
+ std::string repositoryDir;
CAConfig *config;
CAConfig *templ;
@@ -121,8 +121,8 @@
class CATreeCompare
{
public:
- int operator()(const std::vectorblocxx::String &l,
- const std::vectorblocxx::String r) const
+ int operator()(const std::vectorstd::string &l,
+ const std::vectorstd::string r) const
{
if(l.back() == "" && r.back() != "")
{
@@ -149,7 +149,7 @@
};
-CA::CA(const String& caName, const String& caPasswd, const String& repos)
+CA::CA(const std::string& caName, const std::string& caPasswd, const std::string& repos)
{
if(caName.empty())
@@ -163,7 +163,7 @@
{
LOGIT_ERROR("Template does not exists: " << pi.toString());
BLOCXX_THROW_ERR(ca_mgm::SystemException,
- Format(__("Template does not exist: %1."), pi.toString()).c_str(),
+ str::form(__("Template does not exist: %s."), pi.toString().c_str()).c_str(),
E_FILE_NOT_FOUND);
}
@@ -200,14 +200,14 @@
}
}
-blocxx::String
-CA::createSubCA(const String& newCaName,
- const String& keyPasswd,
+std::string
+CA::createSubCA(const std::string& newCaName,
+ const std::string& keyPasswd,
const RequestGenerationData& caRequestData,
const CertificateIssueData& caIssueData)
{
- String certificate = createCertificate(keyPasswd,
+ std::string certificate = createCertificate(keyPasswd,
caRequestData,
caIssueData,
E_CA_Cert);
@@ -224,10 +224,10 @@
__("Error while creating the CA infrastructure."),
e);
}
- String request;
+ std::string request;
PerlRegEx p("^([[:xdigit:]]+):([[:xdigit:]]+[\\d-]*)$");
- StringArray sa = p.capture(certificate);
+ std::vectorstd::string sa = p.capture(certificate);
if(sa.size() == 3)
{
@@ -241,7 +241,7 @@
LOGIT_ERROR("Can not parse certificate name: " << certificate);
// %1 is the name of the CA
BLOCXX_THROW(ca_mgm::RuntimeException,
- Format(__("Cannot parse the certificate name %1."), certificate).c_str());
+ str::form(__("Cannot parse the certificate name %s."), certificate.c_str()).c_str());
}
int r = path::copyFile(m_impl->repositoryDir + "/" + m_impl->caName + "/keys/" + request + ".key",
@@ -287,8 +287,8 @@
}
-blocxx::String
-CA::createRequest(const String& keyPasswd,
+std::string
+CA::createRequest(const std::string& keyPasswd,
const RequestGenerationData& requestData,
Type requestType)
{
@@ -299,23 +299,22 @@
}
// copy template to config
- String configFilename = initConfigFile();
+ std::string configFilename = initConfigFile();
removeDefaultsFromConfig();
OpenSSLUtils ost(configFilename);
- String opensslDN = requestData.getSubjectDN().getOpenSSLString();
- blocxx::MD5 md5(opensslDN);
- String request = md5.toString() + "-" +
- String(Date::now());
+ std::string opensslDN = requestData.getSubjectDN().getOpenSSLString();
+ std::string request = OpenSSLUtils::digestMD5(opensslDN) + "-" +
+ str::numstring(Date::now());
path::PathInfo dKey(m_impl->repositoryDir + "/" + m_impl->caName + "/keys/"+ request + ".key");
if(dKey.exists())
{
LOGIT_ERROR("Duplicate DN. Key '" << request <<".key' already exists.");
BLOCXX_THROW(RuntimeException,
- Format(__("Duplicate DN. Key %1.key already exists."), request).c_str());
+ str::form(__("Duplicate DN. Key %s.key already exists."), request.c_str()).c_str());
}
path::PathInfo r(m_impl->repositoryDir + "/" + m_impl->caName + "/req/"+ request + ".req");
@@ -323,7 +322,7 @@
{
LOGIT_ERROR("Duplicate DN. Request '" << request <<".req' already exists.");
BLOCXX_THROW(RuntimeException,
- Format(__("Duplicate DN. Request %1.req already exists."), request).c_str());
+ str::form(__("Duplicate DN. Request %s.req already exists."), request.c_str()).c_str());
}
// write request data to config
@@ -356,19 +355,19 @@
}
-blocxx::String
-CA::issueCertificate(const String& requestName,
+std::string
+CA::issueCertificate(const std::string& requestName,
const CertificateIssueData& issueData,
Type certType)
{
- String requestFile = String(m_impl->repositoryDir + "/" + m_impl->caName + "/req/"+ requestName + ".req");
+ std::string requestFile = std::string(m_impl->repositoryDir + "/" + m_impl->caName + "/req/"+ requestName + ".req");
path::PathInfo p(requestFile);
if(!p.exists())
{
LOGIT_ERROR("Request does not exist.(" << requestFile << ")");
// %1 is the absolute path to the request
BLOCXX_THROW(ValueException,
- Format(__("Request does not exist (%1)."), requestFile ).c_str());
+ str::form(__("Request does not exist (%s)."), requestFile.c_str() ).c_str());
}
if(!issueData.valid())
@@ -377,8 +376,8 @@
BLOCXX_THROW(ca_mgm::ValueException, __("Invalid issue data."));
}
- String serial = OpenSSLUtils::nextSerial(m_impl->repositoryDir + "/" + m_impl->caName + "/serial");
- String certificate = serial + ":" + requestName;
+ std::string serial = OpenSSLUtils::nextSerial(m_impl->repositoryDir + "/" + m_impl->caName + "/serial");
+ std::string certificate = serial + ":" + requestName;
// parse the CA and check if the end date of the ca is greater
// than the end date of the certificate
@@ -400,7 +399,7 @@
checkDNPolicy(rdata.getSubjectDN(), certType);
// copy template to config
- String configFilename = initConfigFile();
+ std::string configFilename = initConfigFile();
// write data to config
issueData.commit2Config(*this, certType);
@@ -420,8 +419,8 @@
return certificate;
}
-blocxx::String
-CA::createCertificate(const String& keyPasswd,
+std::string
+CA::createCertificate(const std::string& keyPasswd,
const RequestGenerationData& requestData,
const CertificateIssueData& certificateData,
Type type)
@@ -441,7 +440,7 @@
t = E_CA_Req;
}
- String requestName = createRequest(keyPasswd, requestData, t);
+ std::string requestName = createRequest(keyPasswd, requestData, t);
if(type == E_Client_Req || type == E_Client_Cert)
{
@@ -456,7 +455,7 @@
t = E_CA_Cert;
}
- String certificate;
+ std::string certificate;
try
{
@@ -476,7 +475,7 @@
}
void
-CA::revokeCertificate(const String& certificateName,
+CA::revokeCertificate(const std::string& certificateName,
const CRLReason& crlReason)
{
path::PathInfo pi(m_impl->repositoryDir + "/" +
@@ -486,7 +485,7 @@
{
LOGIT_ERROR("File '" << certificateName << ".pem' not found in repository");
BLOCXX_THROW_ERR(ca_mgm::SystemException,
- Format(__("File %1 not found in the repository."), certificateName).c_str(),
+ str::form(__("File %s not found in the repository."), certificateName.c_str()).c_str(),
E_FILE_NOT_FOUND);
}
@@ -497,7 +496,7 @@
}
// copy template to config
- String configFilename = initConfigFile();
+ std::string configFilename = initConfigFile();
OpenSSLUtils ost(configFilename);
@@ -520,7 +519,7 @@
}
// copy template to config
- String configFilename = initConfigFile();
+ std::string configFilename = initConfigFile();
// write crl data to config
crlData.commit2Config(*this, E_CRL);
@@ -545,18 +544,16 @@
rehashCAs(m_impl->repositoryDir + "/.cas/");
}
-blocxx::String
+std::string
CA::importRequestData(const ByteBuffer& request,
FormatType formatType)
{
RequestData rd = RequestData_Priv(request, formatType);
- String name = rd.getSubjectDN().getOpenSSLString();
+ std::string name = rd.getSubjectDN().getOpenSSLString();
- blocxx::MD5 md5(name);
-
- String requestName = md5.toString() + "-" +
- String(Date::now());
+ std::string requestName = OpenSSLUtils::digestMD5(name) + "-" +
+ str::numstring(Date::now());
path::PathInfo outPi(m_impl->repositoryDir + "/" + m_impl->caName + "/req/" + requestName + ".req");
@@ -601,8 +598,8 @@
return requestName;
}
-blocxx::String
-CA::importRequest(const String& requestFile,
+std::string
+CA::importRequest(const std::string& requestFile,
FormatType formatType)
{
ByteBuffer ba = LocalManagement::readFile(requestFile);
@@ -662,22 +659,22 @@
commitConfig2Template();
}
-std::vector >
+std::vector >
CA::getCertificateList()
{
updateDB();
- std::vector< std::map > ret;
+ std::vector< std::map > ret;
ret = OpenSSLUtils::listCertificates(m_impl->caName, m_impl->repositoryDir);
return ret;
}
-std::vector >
+std::vector >
CA::getRequestList()
{
- std::vector< std::map > ret;
+ std::vector< std::map > ret;
ret = OpenSSLUtils::listRequests(m_impl->caName, m_impl->repositoryDir);
@@ -693,13 +690,13 @@
RequestData
-CA::getRequest(const String& requestName)
+CA::getRequest(const std::string& requestName)
{
return RequestData_Priv(m_impl->repositoryDir + "/" + m_impl->caName + "/req/" + requestName + ".req");
}
CertificateData
-CA::getCertificate(const String& certificateName)
+CA::getCertificate(const std::string& certificateName)
{
return CertificateData_Priv(m_impl->repositoryDir + "/" + m_impl->caName +
"/newcerts/" + certificateName + ".pem");
@@ -739,7 +736,7 @@
* If newPassword is empty the returned key is decrypted.
*/
ByteBuffer
-CA::exportCAKeyAsPEM(const String& newPassword)
+CA::exportCAKeyAsPEM(const std::string& newPassword)
{
ByteBuffer ret;
@@ -772,7 +769,7 @@
* will be included.
*/
ByteBuffer
-CA::exportCAasPKCS12(const String& p12Password,
+CA::exportCAasPKCS12(const std::string& p12Password,
bool withChain)
{
ByteBuffer ret;
@@ -794,7 +791,7 @@
*
*/
ByteBuffer
-CA::exportCertificate(const String& certificateName,
+CA::exportCertificate(const std::string& certificateName,
FormatType exportType)
{
ByteBuffer ret;
@@ -817,14 +814,14 @@
* If newPassword is empty the returned key is decrypted.
*/
ByteBuffer
-CA::exportCertificateKeyAsPEM(const String& certificateName,
- const String& keyPassword,
- const String& newPassword)
+CA::exportCertificateKeyAsPEM(const std::string& certificateName,
+ const std::string& keyPassword,
+ const std::string& newPassword)
{
ByteBuffer ret;
PerlRegEx rReq("^[[:xdigit:]]+:([[:xdigit:]]+[\\d-]*)$");
- StringArray sa = rReq.capture(certificateName);
+ std::vectorstd::string sa = rReq.capture(certificateName);
if(sa.size() != 2)
{
@@ -845,13 +842,13 @@
* The private Key is decrypted.
*/
ByteBuffer
-CA::exportCertificateKeyAsDER(const String& certificateName,
- const String& keyPassword)
+CA::exportCertificateKeyAsDER(const std::string& certificateName,
+ const std::string& keyPassword)
{
ByteBuffer ret;
PerlRegEx rReq("^[[:xdigit:]]+:([[:xdigit:]]+[\\d-]*)$");
- StringArray sa = rReq.capture(certificateName);
+ std::vectorstd::string sa = rReq.capture(certificateName);
if(sa.size() != 2)
{
@@ -873,15 +870,15 @@
* will be included.
*/
ByteBuffer
-CA::exportCertificateAsPKCS12(const String& certificateName,
- const String& keyPassword,
- const String& p12Password,
+CA::exportCertificateAsPKCS12(const std::string& certificateName,
+ const std::string& keyPassword,
+ const std::string& p12Password,
bool withChain)
{
ByteBuffer ret;
PerlRegEx rReq("^[[:xdigit:]]+:([[:xdigit:]]+[\\d-]*)$");
- StringArray sa = rReq.capture(certificateName);
+ std::vectorstd::string sa = rReq.capture(certificateName);
if(sa.size() != 2)
{
@@ -931,14 +928,14 @@
void
-CA::deleteRequest(const String& requestName)
+CA::deleteRequest(const std::string& requestName)
{
path::PathInfo reqFile(m_impl->repositoryDir + "/" + m_impl->caName + "/req/" + requestName + ".req");
if(!reqFile.exists())
{
LOGIT_ERROR("Request '" << reqFile.toString() <<"' does not exist." );
- BLOCXX_THROW(ca_mgm::SystemException, Format(__("Request %1 does not exist."),
- reqFile.toString()).c_str());
+ BLOCXX_THROW(ca_mgm::SystemException, str::form(__("Request %s does not exist."),
+ reqFile.toString().c_str()).c_str());
}
OpenSSLUtils::delCAM(m_impl->caName, requestName, m_impl->repositoryDir);
@@ -959,12 +956,12 @@
{
BLOCXX_THROW(ca_mgm::SystemException,
// %1 is the error code
- Format(__("Removing the request failed (%1)."), r).c_str());
+ str::form(__("Removing the request failed (%1)."), r).c_str());
}
}
void
-CA::deleteCertificate(const String& certificateName,
+CA::deleteCertificate(const std::string& certificateName,
bool requestToo)
{
path::PathInfo certFile(m_impl->repositoryDir + "/" + m_impl->caName + "/newcerts/" + certificateName + ".pem");
@@ -972,33 +969,33 @@
{
LOGIT_ERROR("Certificate does not exist." << certFile.toString());
BLOCXX_THROW(ca_mgm::ValueException,
- // %1 is the absolute path to the certificate
- Format(__("Certificate %1 does not exist."),
- certFile.toString()).c_str());
+ // %s is the absolute path to the certificate
+ str::form(__("Certificate %s does not exist."),
+ certFile.toString().c_str()).c_str());
}
PerlRegEx p("^([[:xdigit:]]+):([[:xdigit:]]+[\\d-]*)$");
- StringArray sa = p.capture(certificateName);
+ std::vectorstd::string sa = p.capture(certificateName);
if(sa.size() != 3)
{
LOGIT_ERROR("Can not parse certificate name: " << certificateName);
BLOCXX_THROW(ca_mgm::RuntimeException,
- // %1 is the certificate name
- Format(__("Cannot parse the certificate name %1."), certificateName).c_str());
+ // %s is the certificate name
+ str::form(__("Cannot parse the certificate name %s."), certificateName.c_str()).c_str());
}
- String serial = sa[1];
- String request = sa[2];
+ std::string serial = sa[1];
+ std::string request = sa[2];
- String configFilename = initConfigFile();
+ std::string configFilename = initConfigFile();
OpenSSLUtils ost(configFilename);
- String state = ost.status(serial);
+ std::string state = ost.status(serial);
- if(state.equalsIgnoreCase("Revoked") ||
- state.equalsIgnoreCase("Expired"))
+ if(0 == str::compareCI(state, "Revoked") ||
+ 0 == str::compareCI(state, "Expired"))
{
if(requestToo)
{
@@ -1008,7 +1005,7 @@
}
catch(ca_mgm::SystemException &e)
{
- String msg = e.what();
+ std::string msg = e.what();
if(!PerlRegEx("does\\s+not\\s+exist").match(msg))
{
throw;
@@ -1021,16 +1018,16 @@
if(r != 0)
{
BLOCXX_THROW(ca_mgm::SystemException,
- // %1 is the error code of rm
- Format(__("Removing the certificate failed: %1."), r).c_str());
+ // %2 is the error code of rm
+ str::form(__("Removing the certificate failed: %d."), r).c_str());
}
}
else
{
LOGIT_ERROR("Only revoked or expired certificates can be deleted. " <<
- Format("The status of the certificate is '%1'.", state).c_str());
+ str::form("The status of the certificate is '%s'.", state.c_str()).c_str());
BLOCXX_THROW(ca_mgm::RuntimeException,
- Format(__("Only revoked or expired certificates can be deleted. The status of the certificate is %1."), state).c_str());
+ str::form(__("Only revoked or expired certificates can be deleted. The status of the certificate is %s."), state.c_str()).c_str());
}
}
@@ -1047,7 +1044,7 @@
if(db.size() != 0)
{
- String configFilename = initConfigFile();
+ std::string configFilename = initConfigFile();
OpenSSLUtils ost(configFilename);
@@ -1060,9 +1057,9 @@
}
bool
-CA::verifyCertificate(const String& certificateName,
+CA::verifyCertificate(const std::string& certificateName,
bool crlCheck,
- const String& purpose)
+ const std::string& purpose)
{
path::PathInfo certFile(m_impl->repositoryDir + "/" + m_impl->caName + "/newcerts/" + certificateName + ".pem");
if(!certFile.exists())
@@ -1082,14 +1079,14 @@
{
LOGIT_ERROR("Invalid purpose: " << purpose);
BLOCXX_THROW(ca_mgm::ValueException,
- Format(__("Invalid purpose %1."), purpose).c_str());
+ str::form(__("Invalid purpose %s."), purpose.c_str()).c_str());
}
- String configFilename = initConfigFile();
+ std::string configFilename = initConfigFile();
OpenSSLUtils ost(configFilename);
- String ret = ost.verify(certFile.toString(),
+ std::string ret = ost.verify(certFile.toString(),
m_impl->repositoryDir + "/.cas/",
crlCheck,
purpose);
@@ -1116,11 +1113,11 @@
*/
void
-CA::createRootCA(const String& caName,
- const String& caPasswd,
+CA::createRootCA(const std::string& caName,
+ const std::string& caPasswd,
const RequestGenerationData& caRequestData,
const CertificateIssueData& caIssueData,
- const String& repos)
+ const std::string& repos)
{
if(!caRequestData.valid())
{
@@ -1162,7 +1159,7 @@
CA tmpCA = CA(caName, caPasswd, repos);
// copy template to config
- String configFilename = tmpCA.initConfigFile();
+ std::string configFilename = tmpCA.initConfigFile();
tmpCA.removeDefaultsFromConfig();
@@ -1216,11 +1213,11 @@
void
-CA::importCA(const String& caName,
+CA::importCA(const std::string& caName,
const ByteBuffer& caCertificate,
const ByteBuffer& caKey,
- const String& caPasswd,
- const String& repos)
+ const std::string& caPasswd,
+ const std::string& repos)
{
if(caName.empty())
{
@@ -1258,7 +1255,7 @@
PerlRegEx keyregex("-----BEGIN[\\w\\s]+KEY[-]{5}[\\S\\s\n]+-----END[\\w\\s]+KEY[-]{5}");
- if(!keyregex.match(String(caKey.data(), caKey.size())))
+ if(!keyregex.match(std::string(caKey.data(), caKey.size())))
{
LOGIT_ERROR("Invalid Key data.");
BLOCXX_THROW(ca_mgm::ValueException,
@@ -1273,7 +1270,7 @@
}
PerlRegEx keycrypt("ENCRYPTED");
- if(keycrypt.match( String(caKey.data(), caKey.size()) ))
+ if(keycrypt.match( std::string(caKey.data(), caKey.size()) ))
{
// Try to decrypt the key.
// In case of invalid password rsaConvert throws an exception.
@@ -1294,7 +1291,7 @@
LocalManagement::writeFile(caCertificate, caDir.toString() + "/cacert.pem");
- if(keycrypt.match( String(caKey.data(), caKey.size()) ))
+ if(keycrypt.match( std::string(caKey.data(), caKey.size()) ))
{
LocalManagement::writeFile(caKey,
caDir.toString() + "/cacert.key");
@@ -1350,10 +1347,10 @@
}
-std::vectorblocxx::String
-CA::getCAList(const String& repos)
+std::vectorstd::string
+CA::getCAList(const std::string& repos)
{
- std::vector<String> caList;
+ std::vectorstd::string caList;
caList = OpenSSLUtils::listCA(repos);
@@ -1361,42 +1358,42 @@
}
-std::listblocxx::String >
-CA::getCATree(const String& repos)
+std::liststd::string >
+CA::getCATree(const std::string& repos)
{
- std::list ret;
+ std::liststd::string > ret;
- std::vector<String> caList = CA::getCAList(repos);
+ std::vectorstd::string caList = CA::getCAList(repos);
if(caList.empty())
{
return ret;
}
- std::map caHash;
+ std::mapstd::string > caHash;
- std::vector<String>::const_iterator it = caList.begin();
+ std::vectorstd::string::const_iterator it = caList.begin();
for(; it != caList.end(); ++it)
{
CertificateData caData =
LocalManagement::getCertificate(repos + "/" + (*it) + "/cacert.pem",
E_PEM);
- std::vector<String> d;
+ std::vectorstd::string d;
d.push_back(caData.getSubjectDN().getOpenSSLString());
d.push_back(caData.getIssuerDN().getOpenSSLString());
caHash[*it] = d;
}
- std::map::const_iterator chit = caHash.begin();
+ std::mapstd::string >::const_iterator chit = caHash.begin();
for(; chit != caHash.end(); ++chit)
{
// subject == issuer
if( ((*chit).second)[0] == ((*chit).second)[1] )
{
// root CA
- std::vector<String> d;
+ std::vectorstd::string d;
d.push_back((*chit).first);
d.push_back("");
@@ -1407,13 +1404,13 @@
bool issuerFound = false;
// sub CA; find caName of the issuer
- std::map::const_iterator chitnew = caHash.begin();
+ std::mapstd::string >::const_iterator chitnew = caHash.begin();
for(; chitnew != caHash.end(); ++chitnew)
{
// issuer == subject
if( ((*chit).second)[1] == ((*chitnew).second)[0] )
{
- std::vector<String> d;
+ std::vectorstd::string d;
d.push_back((*chit).first);
d.push_back((*chitnew).first);
@@ -1426,7 +1423,7 @@
if(!issuerFound)
{
// the issuer is not in our repository
- std::vector<String> d;
+ std::vectorstd::string d;
d.push_back((*chit).first);
d.push_back("");
@@ -1441,7 +1438,7 @@
}
CertificateIssueData
-CA::getRootCAIssueDefaults(const String& repos)
+CA::getRootCAIssueDefaults(const std::string& repos)
{
CAConfig *config = new CAConfig(repos+"/openssl.cnf.tmpl");
CertificateIssueData cid = CertificateIssueData(config, E_CA_Cert);
@@ -1451,7 +1448,7 @@
}
RequestGenerationData
-CA::getRootCARequestDefaults(const String& repos)
+CA::getRootCARequestDefaults(const std::string& repos)
{
CAConfig *config = new CAConfig(repos+"/openssl.cnf.tmpl");
RequestGenerationData rgd = RequestGenerationData(config, E_CA_Req);
@@ -1461,10 +1458,10 @@
}
void
-CA::deleteCA(const String& caName,
- const String& caPasswd,
+CA::deleteCA(const std::string& caName,
+ const std::string& caPasswd,
bool force,
- const String& repos)
+ const std::string& repos)
{
if(caName.empty())
{
@@ -1478,8 +1475,8 @@
{
LOGIT_ERROR("CA name does not exist.(" << pi.toString() << ")");
BLOCXX_THROW_ERR(ca_mgm::ValueException,
- // %1 is the absolute path name to the CA
- Format(__("CA name does not exist (%1)."), pi.toString()).c_str(),
+ // %s is the absolute path name to the CA
+ str::form(__("CA name does not exist (%s)."), pi.toString().c_str()).c_str(),
E_FILE_NOT_FOUND);
}
@@ -1535,7 +1532,7 @@
LOGIT_ERROR("Deleting the CA failed: " << r);
BLOCXX_THROW(ca_mgm::SystemException,
// %1 is the error code of rm
- Format(__("Deleting the CA failed: %1."), r).c_str());
+ str::form(__("Deleting the CA failed: %1."), r).c_str());
}
path::PathInfo p(repos + "/.cas/" + caName + ".pem");
@@ -1578,7 +1575,7 @@
type == E_CA_Req || type == E_CRL)
{
LOGIT_ERROR("wrong type" << type);
- BLOCXX_THROW(ca_mgm::ValueException, Format(__("Wrong type: %1."), type).c_str());
+ BLOCXX_THROW(ca_mgm::ValueException, str::form(__("Wrong type: %1."), type).c_str());
}
bool p = m_impl->config->exists(type2Section(type, false), "policy");
@@ -1588,7 +1585,7 @@
BLOCXX_THROW(ca_mgm::SyntaxException,
__("The configuration file is missing a value for policy."));
}
- String policySect = m_impl->config->getValue(type2Section(type, false), "policy");
+ std::string policySect = m_impl->config->getValue(type2Section(type, false), "policy");
StringList policyKeys = m_impl->config->getKeylist(policySect);
@@ -1596,7 +1593,7 @@
{
LOGIT_ERROR("Can not parse Section " << policySect);
BLOCXX_THROW(ca_mgm::SyntaxException,
- Format(__("Cannot parse section %1."), policySect).c_str());
+ str::form(__("Cannot parse section %s."), policySect.c_str()).c_str());
}
StringList::const_iterator it = policyKeys.begin();
@@ -1610,16 +1607,16 @@
policyFound = false; // reset
// could be optional, supplied or match
- String policyString = m_impl->config->getValue(policySect, *it);
+ std::string policyString = m_impl->config->getValue(policySect, *it);
LOGIT_DEBUG("PolicyKey:" << *it << " PolicyString:"<< policyString);
- if(policyString.equalsIgnoreCase("optional"))
+ if(0 == str::compareCI(policyString, "optional"))
{
// do not care
policyFound = true;
}
- else if(policyString.equalsIgnoreCase("supplied"))
+ else if(0 == str::compareCI(policyString, "supplied"))
{
policyFound = true;
@@ -1630,7 +1627,7 @@
for(; rdnit != l.end(); ++rdnit)
{
- if( (*it).equalsIgnoreCase( (*rdnit).getType() ) )
+ if( 0 == str::compareCI(*it, (*rdnit).getType() ) )
{
foundInDN = true;
@@ -1668,8 +1665,8 @@
LOGIT_ERROR("Field '" << *it << "' must have a value");
BLOCXX_THROW_ERR(ca_mgm::ValueException,
- Format(__("Field %1 must have a value."),
- *it).c_str(),
+ str::form(__("Field %s must have a value."),
+ (*it).c_str()).c_str(),
errorCode);
}
}
@@ -1707,14 +1704,14 @@
}
LOGIT_ERROR("The '" << *it << "' field must be defined.");
BLOCXX_THROW_ERR(ca_mgm::ValueException,
- Format(__("%1 must be defined."), *it).c_str(),
+ str::form(__("%s must be defined."), (*it).c_str()).c_str(),
errorCode);
}
}
- else if(policyString.equalsIgnoreCase("match"))
+ else if(0 == str::compareCI(policyString, "match"))
{
- String caMatchValue;
- String reqMatchValue;
+ std::string caMatchValue;
+ std::string reqMatchValue;
// read the CA and check the value
// *it == key (e.g. commonName, emailAddress, ...
@@ -1724,7 +1721,7 @@
for(; rdnit != l.end(); ++rdnit)
{
- if( (*it).equalsIgnoreCase( (*rdnit).getType() ) )
+ if( 0 == str::compareCI(*it, (*rdnit).getType() ) )
{
rdn2check = *rdnit;
break;
@@ -1740,7 +1737,7 @@
LOGIT_DEBUG("Type (ca == request): " <<(*caRdnIT).getType() << "==" << rdn2check.getType());
LOGIT_DEBUG("Value(ca == request): " <<(*caRdnIT).getValue() << "==" << rdn2check.getValue());
- if((*caRdnIT).getType().equalsIgnoreCase(rdn2check.getType()))
+ if(0 == str::compareCI((*caRdnIT).getType(), rdn2check.getType() ))
{
if((*caRdnIT).getValue() == rdn2check.getValue())
{
@@ -1792,8 +1789,8 @@
caMatchValue<<") and the request ("<< reqMatchValue <<")");
BLOCXX_THROW_ERR(ca_mgm::ValueException,
- Format(__("%1 must be the same in the CA certificate (%2) and the request (%3)."),
- *it, caMatchValue, reqMatchValue).c_str(),
+ str::form(__("%s must be the same in the CA certificate (%s) and the request (%s)."),
+ (*it).c_str(), caMatchValue.c_str(), reqMatchValue.c_str()).c_str(),
errorCode);
}
@@ -1810,7 +1807,7 @@
return;
}
-String
+std::string
CA::initConfigFile()
{
return m_impl->initConfigFile();
@@ -1850,7 +1847,7 @@
BLOCXX_THROW(ca_mgm::SyntaxException,
__("Missing section 'distinguished_name' in the configuration file."));
}
- String dnSect = m_impl->config->getValue("req_ca", "distinguished_name");
+ std::string dnSect = m_impl->config->getValue("req_ca", "distinguished_name");
StringList dnKeys = m_impl->config->getKeylist(dnSect);
@@ -1858,13 +1855,13 @@
{
LOGIT_ERROR("Can not parse Section " << dnSect);
BLOCXX_THROW(ca_mgm::SyntaxException,
- Format(__("Cannot parse section %1."), dnSect).c_str());
+ str::form(__("Cannot parse section %s."), dnSect.c_str()).c_str());
}
StringList::const_iterator it = dnKeys.begin();
for(; it != dnKeys.end(); ++it)
{
- if((*it).endsWith("_default", String::E_CASE_INSENSITIVE))
+ if(str::endsWithCI(*it, "_default"))
{
// delete the default value
m_impl->config->deleteValue(dnSect, *it);
Modified: limal-branches/mc-devel/limal-ca-mgm/src/CAConfig.cpp
URL: http://svn.opensuse.org/viewcvs/limal/limal-branches/mc-devel/limal-ca-mgm/src/CAConfig.cpp?rev=2675&r1=2674&r2=2675&view=diff
==============================================================================
--- limal-branches/mc-devel/limal-ca-mgm/src/CAConfig.cpp (original)
+++ limal-branches/mc-devel/limal-ca-mgm/src/CAConfig.cpp Sat Jul 3 13:27:18 2010
@@ -45,10 +45,10 @@
public:
CAConfigImpl()
: parser(INIParser ())
- , srcFilename(String())
+ , srcFilename(std::string())
{}
- CAConfigImpl(const String &file)
+ CAConfigImpl(const std::string &file)
: parser(INIParser ())
, srcFilename(file)
{}
@@ -68,16 +68,16 @@
}
INI::INIParser parser;
- String srcFilename;
+ std::string srcFilename;
};
-CAConfig::CAConfig(const String &file)
+CAConfig::CAConfig(const std::string &file)
: m_impl(new CAConfigImpl(file))
{
std::vector<Options> options;
- std::vectorblocxx::String commentsDescr;
+ std::vectorstd::string commentsDescr;
std::vector<SectionDescr> sectionDescr;
std::vector<EntryDescr> entryDescr;
std::vector<IoPatternDescr> rewrites;
@@ -119,13 +119,13 @@
void
CAConfig::dumpTree(CASection *casection, int level)
{
- String tab = "";
+ std::string tab = "";
for (int i = 0; i <= level; i++) tab += " ";
if (level == 0)
LOGIT_INFO (tab);
- String sectionComment = casection->section->getComment();
+ std::string sectionComment = casection->section->getComment();
if (sectionComment.length() > 0)
LOGIT_INFO (tab <<
"SectionComment " << casection->section->getComment());
@@ -134,7 +134,7 @@
for (EntryMap::iterator i = eMap.begin(); i != eMap.end(); i++)
{
Entry entry = i->second;
- String comment = entry.getComment();
+ std::string comment = entry.getComment();
if (comment.length() > 0)
LOGIT_INFO (tab <<
"Comment " << i->first << " : " << entry.getComment());
@@ -156,7 +156,7 @@
void
-CAConfig::setValue(const String §ion, const String &key, const String &value)
+CAConfig::setValue(const std::string §ion, const std::string &key, const std::string &value)
{
if (m_impl->parser.iniFile.contains (section) == NO)
{
@@ -174,7 +174,7 @@
}
void
-CAConfig::deleteValue(const String §ion, const String &key)
+CAConfig::deleteValue(const std::string §ion, const std::string &key)
{
if (m_impl->parser.iniFile.contains (section) == SECTION)
{
@@ -185,8 +185,8 @@
}
}
-blocxx::String
-CAConfig::getValue(const String §ion, const String &key) const
+std::string
+CAConfig::getValue(const std::string §ion, const std::string &key) const
{
if (m_impl->parser.iniFile.contains (section) == SECTION)
{
@@ -197,7 +197,7 @@
}
bool
-CAConfig::exists(const String §ion, const String &key) const
+CAConfig::exists(const std::string §ion, const std::string &key) const
{
if (m_impl->parser.iniFile.contains(section) == SECTION)
{
@@ -209,10 +209,10 @@
return false;
}
-std::listblocxx::String
-CAConfig::getKeylist(const String §ion) const
+std::liststd::string
+CAConfig::getKeylist(const std::string §ion) const
{
- std::list<String> keylist;
+ std::liststd::string keylist;
if (m_impl->parser.iniFile.contains(section) == SECTION)
{
@@ -222,13 +222,13 @@
}
void
-CAConfig::copySection(const String &srcSection, const String &destSection)
+CAConfig::copySection(const std::string &srcSection, const std::string &destSection)
{
- std::list<String> keylist;
+ std::liststd::string keylist;
keylist = getKeylist(srcSection);
- std::list<String>::const_iterator it = keylist.begin();
+ std::liststd::string::const_iterator it = keylist.begin();
for(; it != keylist.end(); ++it)
{
@@ -237,7 +237,7 @@
}
CAConfig*
-CAConfig::clone(const String &file)
+CAConfig::clone(const std::string &file)
{
ifstream in (m_impl->srcFilename.c_str());
ofstream out (file.c_str());
@@ -262,7 +262,7 @@
return new CAConfig (file);
}
-String
+std::string
CAConfig::filename() const
{
return m_impl->srcFilename;
Modified: limal-branches/mc-devel/limal-ca-mgm/src/CRLData.cpp
URL: http://svn.opensuse.org/viewcvs/limal/limal-branches/mc-devel/limal-ca-mgm/src/CRLData.cpp?rev=2675&r1=2674&r2=2675&view=diff
==============================================================================
--- limal-branches/mc-devel/limal-ca-mgm/src/CRLData.cpp (original)
+++ limal-branches/mc-devel/limal-ca-mgm/src/CRLData.cpp Sat Jul 3 13:27:18 2010
@@ -1,4 +1,4 @@
-#/*---------------------------------------------------------------------\
+/*---------------------------------------------------------------------\
| |
| _ _ _ _ __ _ |
| | | | | | \_/ | / \ | | |
@@ -59,7 +59,7 @@
return *this;
}
-blocxx::String
+std::string
RevocationEntry::getSerial() const
{
return m_impl->serial;
@@ -88,14 +88,14 @@
return m_impl->revocationReason.valid();
}
-std::vectorblocxx::String
+std::vectorstd::string
RevocationEntry::verify() const
{
- std::vectorblocxx::String result;
+ std::vectorstd::string result;
if(!initHexCheck().isValid(m_impl->serial))
{
- result.push_back(Format("invalid serial: %1", m_impl->serial).toString());
+ result.push_back(str::form("invalid serial: %s", m_impl->serial.c_str()));
}
appendArray(result, m_impl->revocationReason.verify());
@@ -104,14 +104,14 @@
return result;
}
-std::vectorblocxx::String
+std::vectorstd::string
RevocationEntry::dump() const
{
- std::vectorblocxx::String result;
+ std::vectorstd::string result;
result.push_back("RevocationEntry::dump()");
result.push_back("Serial = " + m_impl->serial);
- result.push_back("revocation Date = " + String(m_impl->revocationDate));
+ result.push_back("revocation Date = " + str::numstring(m_impl->revocationDate));
appendArray(result, m_impl->revocationReason.dump());
return result;
@@ -143,7 +143,7 @@
return m_impl->version;
}
-blocxx::String
+std::string
CRLData::getFingerprint() const
{
return m_impl->fingerprint;
@@ -173,7 +173,7 @@
return m_impl->signatureAlgorithm;
}
-blocxx::String
+std::string
CRLData::getSignatureAlgorithmAsString() const
{
switch(m_impl->signatureAlgorithm)
@@ -188,7 +188,7 @@
return "SHA1DSA";
break;
}
- return String();
+ return std::string();
}
ByteBuffer
@@ -203,14 +203,14 @@
return m_impl->extensions;
}
-std::map
+std::map
CRLData::getRevocationData() const
{
return m_impl->revocationData;
}
RevocationEntry
-CRLData::getRevocationEntry(const String& oid)
+CRLData::getRevocationEntry(const std::string& oid)
{
if(m_impl->revocationData.find(oid) != m_impl->revocationData.end())
{
@@ -221,7 +221,7 @@
__("Entry not found."));
}
-blocxx::String
+std::string
CRLData::getCRLAsText() const
{
unsigned char *ustringval = NULL;
@@ -231,13 +231,13 @@
X509_CRL_print(bio, m_impl->x509);
n = BIO_get_mem_data(bio, &ustringval);
- String text = String((const char*)ustringval, n);
+ std::string text = std::string((const char*)ustringval, n);
BIO_free(bio);
return text;
}
-blocxx::String
+std::string
CRLData::getExtensionsAsText() const
{
unsigned char *ustringval = NULL;
@@ -247,7 +247,7 @@
X509V3_extensions_print(bio, NULL, m_impl->x509->crl->extensions, 0, 4);
n = BIO_get_mem_data(bio, &ustringval);
- String extText = String((const char*)ustringval, n);
+ std::string extText = std::string((const char*)ustringval, n);
BIO_free(bio);
return extText;
@@ -275,7 +275,7 @@
if(!m_impl->extensions.valid()) return false;
- std::vectorblocxx::String r = checkRevocationData(m_impl->revocationData);
+ std::vectorstd::string r = checkRevocationData(m_impl->revocationData);
if(!r.empty())
{
LOGIT_DEBUG(r[0]);
@@ -284,22 +284,22 @@
return true;
}
-std::vectorblocxx::String
+std::vectorstd::string
CRLData::verify() const
{
- std::vectorblocxx::String result;
+ std::vectorstd::string result;
if(m_impl->version < 1 || m_impl->version > 2)
{
- result.push_back(Format("invalid version: %1", m_impl->version).toString());
+ result.push_back(str::form("invalid version: %d", m_impl->version));
}
if(m_impl->lastUpdate == 0)
{
- result.push_back(Format("invalid lastUpdate: %1", m_impl->lastUpdate).toString());
+ result.push_back(str::form("invalid lastUpdate: %ld", m_impl->lastUpdate));
}
if(m_impl->nextUpdate <= m_impl->lastUpdate)
{
- result.push_back(Format("invalid nextUpdate: %1", m_impl->nextUpdate).toString());
+ result.push_back(str::form("invalid nextUpdate: %ld", m_impl->nextUpdate));
}
appendArray(result, m_impl->issuer.verify());
@@ -311,31 +311,29 @@
return result;
}
-std::vectorblocxx::String
+std::vectorstd::string
CRLData::dump() const
{
- std::vectorblocxx::String result;
+ std::vectorstd::string result;
result.push_back("CRLData::dump()");
- result.push_back("Version = " + String(m_impl->version));
+ result.push_back("Version = " + str::numstring(m_impl->version));
result.push_back("Fingerprint = " + m_impl->fingerprint);
- result.push_back("last Update = " + String(m_impl->lastUpdate));
- result.push_back("next Update = " + String(m_impl->nextUpdate));
+ result.push_back("last Update = " + str::numstring(m_impl->lastUpdate));
+ result.push_back("next Update = " + str::numstring(m_impl->nextUpdate));
appendArray(result, m_impl->issuer.dump());
- result.push_back("signatureAlgorithm = "+ String(m_impl->signatureAlgorithm));
+ result.push_back("signatureAlgorithm = "+ str::numstring(m_impl->signatureAlgorithm));
- String s;
+ std::string s;
for(uint i = 0; i < m_impl->signature.size(); ++i)
{
- String d;
- d.format("%02x:", static_cast<UInt8>(m_impl->signature[i]));
- s += d;
+ s += str::form( "%02x", static_cast<UInt8>(m_impl->signature[i]));
}
result.push_back("Signature = " + s);
appendArray(result, m_impl->extensions.dump());
- std::map< String, RevocationEntry >::const_iterator it = m_impl->revocationData.begin();
+ std::map< std::string, RevocationEntry >::const_iterator it = m_impl->revocationData.begin();
for(; it != m_impl->revocationData.end(); ++it)
{
result.push_back((*it).first);
@@ -350,11 +348,11 @@
: m_impl(new CRLDataImpl())
{}
-std::vectorblocxx::String
-CRLData::checkRevocationData(const std::map& rd) const
+std::vectorstd::string
+CRLData::checkRevocationData(const std::map& rd) const
{
- std::vectorblocxx::String result;
- std::map::const_iterator it = rd.begin();
+ std::vectorstd::string result;
+ std::map::const_iterator it = rd.begin();
for(; it != rd.end(); ++it)
{
appendArray(result, ((*it).second).verify());
Modified: limal-branches/mc-devel/limal-ca-mgm/src/CRLDataImpl.hpp
URL: http://svn.opensuse.org/viewcvs/limal/limal-branches/mc-devel/limal-ca-mgm/src/CRLDataImpl.hpp?rev=2675&r1=2674&r2=2675&view=diff
==============================================================================
--- limal-branches/mc-devel/limal-ca-mgm/src/CRLDataImpl.hpp (original)
+++ limal-branches/mc-devel/limal-ca-mgm/src/CRLDataImpl.hpp Sat Jul 3 13:27:18 2010
@@ -54,7 +54,7 @@
return new RevocationEntryImpl(*this);
}
- String serial;
+ std::string serial;
time_t revocationDate;
CRLReason revocationReason;
@@ -72,7 +72,7 @@
, signatureAlgorithm(E_SHA1RSA)
, signature(ByteBuffer())
, extensions(X509v3CRLExts_Priv())
- , revocationData(std::map())
+ , revocationData(std::map())
, x509(NULL)
{}
@@ -105,7 +105,7 @@
}
int32_t version;
- String fingerprint;
+ std::string fingerprint;
time_t lastUpdate;
time_t nextUpdate;
@@ -116,7 +116,7 @@
X509v3CRLExts extensions;
- std::map revocationData;
+ std::map revocationData;
X509_CRL *x509;
};
Modified: limal-branches/mc-devel/limal-ca-mgm/src/CRLData_Priv.cpp
URL: http://svn.opensuse.org/viewcvs/limal/limal-branches/mc-devel/limal-ca-mgm/src/CRLData_Priv.cpp?rev=2675&r1=2674&r2=2675&view=diff
==============================================================================
--- limal-branches/mc-devel/limal-ca-mgm/src/CRLData_Priv.cpp (original)
+++ limal-branches/mc-devel/limal-ca-mgm/src/CRLData_Priv.cpp Sat Jul 3 13:27:18 2010
@@ -64,7 +64,7 @@
i2a_ASN1_INTEGER(bioS, rev->serialNumber);
n = BIO_get_mem_data(bioS, &ustringval);
- setSerial(String(reinterpret_cast(ustringval), n));
+ setSerial(std::string(reinterpret_cast(ustringval), n));
BIO_free(bioS);
LOGIT_DEBUG("=>=> New Entry with Serial: " << getSerial());
@@ -87,7 +87,7 @@
setReason( CRLReason_Priv(rev->extensions) );
}
-RevocationEntry_Priv::RevocationEntry_Priv(const String& serial,
+RevocationEntry_Priv::RevocationEntry_Priv(const std::string& serial,
time_t revokeDate,
const CRLReason& reason)
: RevocationEntry()
@@ -96,9 +96,9 @@
{
LOGIT_ERROR("invalid serial: " << serial);
BLOCXX_THROW(ca_mgm::ValueException,
- Format(__("Invalid serial %1."), serial).c_str());
+ str::form(__("Invalid serial %s."), serial.c_str()).c_str());
}
- std::vectorblocxx::String r = reason.verify();
+ std::vectorstd::string r = reason.verify();
if(!r.empty())
{
LOGIT_ERROR(r[0]);
@@ -127,13 +127,13 @@
}
void
-RevocationEntry_Priv::setSerial(const String& serial)
+RevocationEntry_Priv::setSerial(const std::string& serial)
{
if(!initHexCheck().isValid(serial))
{
LOGIT_ERROR("invalid serial: " << serial);
BLOCXX_THROW(ca_mgm::ValueException,
- Format(__("Invalid serial %1."), serial).c_str());
+ str::form(__("Invalid serial %s."), serial.c_str()).c_str());
}
m_impl->serial = serial;
}
@@ -171,7 +171,7 @@
}
-CRLData_Priv::CRLData_Priv(const String &crlPath,
+CRLData_Priv::CRLData_Priv(const std::string &crlPath,
FormatType formatType)
: CRLData()
{
@@ -194,7 +194,7 @@
}
void
-CRLData_Priv::setFingerprint(const String& fp)
+CRLData_Priv::setFingerprint(const std::string& fp)
{
m_impl->fingerprint = fp;
}
@@ -210,7 +210,7 @@
void
CRLData_Priv::setIssuerDN(const DNObject& issuer)
{
- std::vectorblocxx::String r = issuer.verify();
+ std::vectorstd::string r = issuer.verify();
if(!r.empty())
{
LOGIT_ERROR(r[0]);
@@ -234,7 +234,7 @@
void
CRLData_Priv::setExtensions(const X509v3CRLExts& ext)
{
- std::vectorblocxx::String r = ext.verify();
+ std::vectorstd::string r = ext.verify();
if(!r.empty())
{
LOGIT_ERROR(r[0]);
@@ -244,9 +244,9 @@
}
void
-CRLData_Priv::setRevocationData(const std::map& data)
+CRLData_Priv::setRevocationData(const std::map& data)
{
- std::vectorblocxx::String r = checkRevocationData(data);
+ std::vectorstd::string r = checkRevocationData(data);
if(!r.empty())
{
LOGIT_ERROR(r[0]);
@@ -293,7 +293,7 @@
}
}
n = BIO_get_mem_data(bioFP, &ustringval);
- setFingerprint(String(reinterpret_cast(ustringval), n));
+ setFingerprint(std::string(reinterpret_cast(ustringval), n));
BIO_free(bioFP);
// get lastUpdate
@@ -352,7 +352,7 @@
{
LOGIT_ERROR("Unsupported signature algorithm: '" << sbuf << "'");
BLOCXX_THROW(ca_mgm::RuntimeException,
- Format(__("Unsupported signature algorithm %1."), sbuf).c_str());
+ str::form(__("Unsupported signature algorithm %s."), sbuf.c_str()).c_str());
}
// get signature
@@ -364,13 +364,13 @@
// get revocationData
- std::map revData;
+ std::map revData;
for (int i=0; icrl->revoked); i++)
{
RevocationEntry_Priv revEntry(sk_X509_REVOKED_value(x509->crl->revoked,i));
- String ser = revEntry.getSerial();
+ std::string ser = revEntry.getSerial();
revData[ser] = revEntry;
}
setRevocationData(revData);
Modified: limal-branches/mc-devel/limal-ca-mgm/src/CRLData_Priv.hpp
URL: http://svn.opensuse.org/viewcvs/limal/limal-branches/mc-devel/limal-ca-mgm/src/CRLData_Priv.hpp?rev=2675&r1=2674&r2=2675&view=diff
==============================================================================
--- limal-branches/mc-devel/limal-ca-mgm/src/CRLData_Priv.hpp (original)
+++ limal-branches/mc-devel/limal-ca-mgm/src/CRLData_Priv.hpp Sat Jul 3 13:27:18 2010
@@ -36,7 +36,7 @@
public:
RevocationEntry_Priv();
RevocationEntry_Priv(X509_REVOKED *rev);
- RevocationEntry_Priv(const String& serial,
+ RevocationEntry_Priv(const std::string& serial,
time_t revokeDate,
const CRLReason& reason);
RevocationEntry_Priv(const RevocationEntry_Priv& entry);
@@ -44,7 +44,7 @@
RevocationEntry_Priv& operator=(const RevocationEntry_Priv& entry);
- void setSerial(const String& serial);
+ void setSerial(const std::string& serial);
void setRevocationDate(time_t date);
void setReason(const CRLReason& reason);
@@ -56,7 +56,7 @@
CRLData_Priv();
CRLData_Priv(const ByteBuffer &crl,
FormatType formatType = E_PEM);
- CRLData_Priv(const String &crlPath,
+ CRLData_Priv(const std::string &crlPath,
FormatType formatType = E_PEM);
CRLData_Priv(const CRLData_Priv& data);
virtual ~CRLData_Priv();
@@ -65,7 +65,7 @@
setVersion(int32_t version);
void
- setFingerprint(const String& fp);
+ setFingerprint(const std::string& fp);
void
setValidityPeriod(time_t last,
@@ -84,7 +84,7 @@
setExtensions(const X509v3CRLExts& ext);
void
- setRevocationData(const std::map& data);
+ setRevocationData(const std::map& data);
private:
CRLData_Priv& operator=(const CRLData_Priv& data);
Modified: limal-branches/mc-devel/limal-ca-mgm/src/CRLDistributionPointsExtension.cpp
URL: http://svn.opensuse.org/viewcvs/limal/limal-branches/mc-devel/limal-ca-mgm/src/CRLDistributionPointsExtension.cpp?rev=2675&r1=2674&r2=2675&view=diff
==============================================================================
--- limal-branches/mc-devel/limal-ca-mgm/src/CRLDistributionPointsExtension.cpp (original)
+++ limal-branches/mc-devel/limal-ca-mgm/src/CRLDistributionPointsExtension.cpp Sat Jul 3 13:27:18 2010
@@ -71,20 +71,20 @@
{
LOGIT_ERROR("wrong type" << type);
BLOCXX_THROW(ca_mgm::ValueException,
- Format(__("Wrong type: %1."), type).c_str());
+ str::form(__("Wrong type: %1."), type).c_str());
}
bool p = caConfig->exists(type2Section(type, true), "crlDistributionPoints");
if(p)
{
- std::vectorblocxx::String sp = convStringArray(PerlRegEx("\\s*,\\s*")
- .split(caConfig->getValue(type2Section(type, true), "crlDistributionPoints")));
- if(sp[0].equalsIgnoreCase("critical")) setCritical(true);
+ std::vectorstd::string sp = PerlRegEx("\\s*,\\s*")
+ .split(caConfig->getValue(type2Section(type, true), "crlDistributionPoints"));
+ if(0 == str::compareCI(sp[0], "critical")) setCritical(true);
- std::vectorblocxx::String::const_iterator it = sp.begin();
+ std::vectorstd::string::const_iterator it = sp.begin();
for(; it != sp.end(); ++it)
{
- if((*it).indexOf(":") != String::npos)
+ if((*it).find_first_of(":") != std::string::npos)
{
try
{
@@ -123,7 +123,7 @@
void
CRLDistributionPointsExt::setCRLDistributionPoints(std::list<LiteralValue> dp)
{
- std::vectorblocxx::String r = checkLiteralValueList(dp);
+ std::vectorstd::string r = checkLiteralValueList(dp);
if(!r.empty())
{
LOGIT_ERROR(r[0]);
@@ -161,16 +161,16 @@
{
LOGIT_ERROR("wrong type" << type);
BLOCXX_THROW(ca_mgm::ValueException,
- Format(__("Wrong type: %1."), type).c_str());
+ str::form(__("Wrong type: %1."), type).c_str());
}
if(isPresent())
{
- String extString;
+ std::string extString;
if(isCritical()) extString += "critical,";
- String val;
+ std::string val;
std::list<LiteralValue>::const_iterator it = m_impl->altNameList.begin();
for(int j = 0;it != m_impl->altNameList.end(); ++it, ++j)
{
@@ -201,7 +201,7 @@
if(m_impl->altNameList.empty()) return false;
- std::vectorblocxx::String r = checkLiteralValueList(m_impl->altNameList);
+ std::vectorstd::string r = checkLiteralValueList(m_impl->altNameList);
if(!r.empty())
{
LOGIT_DEBUG(r[0]);
@@ -210,16 +210,16 @@
return true;
}
-std::vectorblocxx::String
+std::vectorstd::string
CRLDistributionPointsExt::verify() const
{
- std::vectorblocxx::String result;
+ std::vectorstd::string result;
if(!isPresent()) return result;
if(m_impl->altNameList.empty())
{
- result.push_back(String("No value for CRLDistributionPointsExt."));
+ result.push_back(std::string("No value for CRLDistributionPointsExt."));
}
appendArray(result, checkLiteralValueList(m_impl->altNameList));
@@ -227,10 +227,10 @@
return result;
}
-std::vectorblocxx::String
+std::vectorstd::string
CRLDistributionPointsExt::dump() const
{
- std::vectorblocxx::String result;
+ std::vectorstd::string result;
result.push_back("CRLDistributionPointsExt::dump()");
appendArray(result, ExtensionBase::dump());
Modified: limal-branches/mc-devel/limal-ca-mgm/src/CRLGenerationData.cpp
URL: http://svn.opensuse.org/viewcvs/limal/limal-branches/mc-devel/limal-ca-mgm/src/CRLGenerationData.cpp?rev=2675&r1=2674&r2=2675&view=diff
==============================================================================
--- limal-branches/mc-devel/limal-ca-mgm/src/CRLGenerationData.cpp (original)
+++ limal-branches/mc-devel/limal-ca-mgm/src/CRLGenerationData.cpp Sat Jul 3 13:27:18 2010
@@ -76,14 +76,14 @@
: m_impl(new CRLGenerationDataImpl())
{
m_impl->extensions = X509v3CRLGenerationExts(caConfig, type);
- m_impl->crlHours = caConfig->getValue(type2Section(type, false), "default_crl_hours").toUInt32();
+ m_impl->crlHours = str::strtonum(caConfig->getValue(type2Section(type, false), "default_crl_hours"));
}
CRLGenerationData::CRLGenerationData(uint32_t hours,
const X509v3CRLGenerationExts& ext)
: m_impl(new CRLGenerationDataImpl(hours, ext))
{
- std::vectorblocxx::String r = ext.verify();
+ std::vectorstd::string r = ext.verify();
if(!r.empty())
{
LOGIT_ERROR(r[0]);
@@ -123,7 +123,7 @@
void
CRLGenerationData::setExtensions(const X509v3CRLGenerationExts& ext)
{
- std::vectorblocxx::String r = ext.verify();
+ std::vectorstd::string r = ext.verify();
if(!r.empty())
{
LOGIT_ERROR(r[0]);
@@ -158,12 +158,12 @@
{
LOGIT_ERROR("wrong type" << type);
BLOCXX_THROW(ca_mgm::ValueException,
- Format(__("Wrong type: %1."), type).c_str());
+ str::form(__("Wrong type: %d."), type).c_str());
}
ca.getConfig()->setValue(type2Section(type, false),
"default_crl_hours",
- String(m_impl->crlHours));
+ str::numstring(m_impl->crlHours));
m_impl->extensions.commit2Config(ca, type);
}
@@ -179,14 +179,14 @@
return m_impl->extensions.valid();
}
-std::vectorblocxx::String
+std::vectorstd::string
CRLGenerationData::verify() const
{
- std::vectorblocxx::String result;
+ std::vectorstd::string result;
if(m_impl->crlHours == 0)
{
- result.push_back(Format("invalid crlhours: %1", m_impl->crlHours).toString());
+ result.push_back(str::form("invalid crlhours: %d", m_impl->crlHours));
}
appendArray(result, m_impl->extensions.verify());
@@ -195,13 +195,13 @@
return result;
}
-std::vectorblocxx::String
+std::vectorstd::string
CRLGenerationData::dump() const
{
- std::vectorblocxx::String result;
+ std::vectorstd::string result;
result.push_back("CRLGenerationData::dump()");
- result.push_back("CRL Hours = " + String(m_impl->crlHours));
+ result.push_back("CRL Hours = " + str::numstring(m_impl->crlHours));
appendArray(result, m_impl->extensions.dump());
return result;
Modified: limal-branches/mc-devel/limal-ca-mgm/src/CRLReason.cpp
URL: http://svn.opensuse.org/viewcvs/limal/limal-branches/mc-devel/limal-ca-mgm/src/CRLReason.cpp?rev=2675&r1=2674&r2=2675&view=diff
==============================================================================
--- limal-branches/mc-devel/limal-ca-mgm/src/CRLReason.cpp (original)
+++ limal-branches/mc-devel/limal-ca-mgm/src/CRLReason.cpp Sat Jul 3 13:27:18 2010
@@ -44,7 +44,7 @@
, holdInstruction("holdInstructionNone")
{}
- CRLReasonImpl(const String& reason)
+ CRLReasonImpl(const std::string& reason)
: reason(reason)
, compromiseDate(0)
, holdInstruction("holdInstructionNone")
@@ -64,7 +64,7 @@
return new CRLReasonImpl(*this);
}
- String reason;
+ std::string reason;
// used if reason is keyCompromise or CACompromise.
// 0 == no compromise Date set
@@ -76,7 +76,7 @@
// holdInstructionCallIssuer,
// holdInstructionReject
// or an OID
- String holdInstruction;
+ std::string holdInstruction;
};
@@ -89,13 +89,13 @@
// ----------------------------------------------------------------------------
-CRLReason::CRLReason(const String& reason)
+CRLReason::CRLReason(const std::string& reason)
: m_impl(new CRLReasonImpl(reason))
{
if(!checkReason(reason))
{
BLOCXX_THROW(ca_mgm::ValueException,
- Format(__("Invalid revoke reason %1."), reason).c_str());
+ str::form(__("Invalid revoke reason %s."), reason.c_str()).c_str());
}
}
@@ -125,20 +125,20 @@
// ----------------------------------------------------------------------------
void
-CRLReason::setReason(const String& reason)
+CRLReason::setReason(const std::string& reason)
{
if(!checkReason(reason))
{
BLOCXX_THROW(ca_mgm::ValueException,
- // %1 is the wrong reason string
- Format(__("Invalid revoke reason %1."), reason).c_str());
+ // %s is the wrong reason string
+ str::form(__("Invalid revoke reason %s."), reason.c_str()).c_str());
}
m_impl->reason = reason;
}
// ----------------------------------------------------------------------------
-blocxx::String
+std::string
CRLReason::getReason() const
{
return m_impl->reason;
@@ -147,9 +147,9 @@
// ----------------------------------------------------------------------------
void
-CRLReason::setHoldInstruction(const String& holdInstruction)
+CRLReason::setHoldInstruction(const std::string& holdInstruction)
{
- String r = checkHoldInstruction(holdInstruction);
+ std::string r = checkHoldInstruction(holdInstruction);
if(!r.empty())
{
LOGIT_ERROR(r);
@@ -162,10 +162,10 @@
// ----------------------------------------------------------------------------
-blocxx::String
+std::string
CRLReason::getHoldInstruction() const
{
- if(!m_impl->reason.equalsIgnoreCase("certificateHold"))
+ if(0 != str::compareCI(m_impl->reason, "certificateHold"))
{
LOGIT_ERROR("Reason is not certificateHold");
BLOCXX_THROW(ca_mgm::RuntimeException,
@@ -188,7 +188,7 @@
time_t
CRLReason::getKeyCompromiseDate() const
{
- if(!m_impl->reason.equalsIgnoreCase("keyCompromise"))
+ if(0 != str::compareCI(m_impl->reason, "keyCompromise"))
{
LOGIT_ERROR("Reason is not keyCompromise");
BLOCXX_THROW(ca_mgm::RuntimeException,
@@ -199,21 +199,21 @@
// ----------------------------------------------------------------------------
-blocxx::String
+std::string
CRLReason::getKeyCompromiseDateAsString() const
{
- if(!m_impl->reason.equalsIgnoreCase("keyCompromise"))
+ if(0 != str::compareCI(m_impl->reason, "keyCompromise"))
{
LOGIT_ERROR("Reason is not keyCompromise");
BLOCXX_THROW(ca_mgm::RuntimeException,
__("Reason is not keyCompromise."));
}
- String time;
+ std::string time;
if(m_impl->compromiseDate != 0)
{
Date dt(m_impl->compromiseDate);
- time = String(dt.form("%Y%m%d%H%M%SZ", true));
+ time = std::string(dt.form("%Y%m%d%H%M%SZ", true));
}
return time;
@@ -233,7 +233,7 @@
time_t
CRLReason::getCACompromiseDate() const
{
- if(!m_impl->reason.equalsIgnoreCase("CACompromise"))
+ if(0 != str::compareCI(m_impl->reason, "CACompromise"))
{
LOGIT_ERROR("Reason is not CACompromise");
BLOCXX_THROW(ca_mgm::RuntimeException,
@@ -244,21 +244,21 @@
// ----------------------------------------------------------------------------
-blocxx::String
+std::string
CRLReason::getCACompromiseDateAsString() const
{
- if(!m_impl->reason.equalsIgnoreCase("CACompromise"))
+ if(0 != str::compareCI(m_impl->reason, "CACompromise"))
{
LOGIT_ERROR("Reason is not CACompromise");
BLOCXX_THROW(ca_mgm::RuntimeException,
__("Reason is not CACompromise."));
}
- String time;
+ std::string time;
if(m_impl->compromiseDate != 0)
{
Date dt(m_impl->compromiseDate);
- time = String(dt.form("%Y%m%d%H%M%SZ", true));
+ time = std::string(dt.form("%Y%m%d%H%M%SZ", true));
}
return time;
@@ -269,9 +269,9 @@
bool
CRLReason::valid() const
{
- if(m_impl->reason.equalsIgnoreCase("certificateHold"))
+ if(0 == str::compareCI(m_impl->reason, "certificateHold"))
{
- String r = checkHoldInstruction(m_impl->holdInstruction);
+ std::string r = checkHoldInstruction(m_impl->holdInstruction);
if(!r.empty())
{
LOGIT_DEBUG(r);
@@ -286,14 +286,14 @@
// ----------------------------------------------------------------------------
-std::vectorblocxx::String
+std::vectorstd::string
CRLReason::verify() const
{
- std::vectorblocxx::String result;
+ std::vectorstd::string result;
- if(m_impl->reason.equalsIgnoreCase("certificateHold"))
+ if(0 == str::compareCI(m_impl->reason, "certificateHold"))
{
- String err = checkHoldInstruction(m_impl->holdInstruction);
+ std::string err = checkHoldInstruction(m_impl->holdInstruction);
if(!err.empty())
{
result.push_back(err);
@@ -301,7 +301,7 @@
}
else if(!checkReason(m_impl->reason))
{
- result.push_back(Format("Invalid revoke reason", m_impl->reason));
+ result.push_back(str::form("Invalid revoke reason: %s", m_impl->reason.c_str()));
}
// compromiseDate == 0 is now a valid date
@@ -312,22 +312,22 @@
// ----------------------------------------------------------------------------
-std::vectorblocxx::String
+std::vectorstd::string
CRLReason::dump() const
{
- std::vectorblocxx::String result;
+ std::vectorstd::string result;
result.push_back("CRLReason::dump()");
- result.push_back(Format("Revoke Reason = %1", m_impl->reason));
+ result.push_back(str::form("Revoke Reason = %s", m_impl->reason.c_str()));
- if(m_impl->reason.equalsIgnoreCase("certificateHold"))
+ if(0 == str::compareCI(m_impl->reason, "certificateHold"))
{
result.push_back("hold Instruction =" + m_impl->holdInstruction);
}
- else if(m_impl->reason.equalsIgnoreCase("keyCompromise") ||
- m_impl->reason.equalsIgnoreCase("CACompromise"))
+ else if(0 == str::compareCI(m_impl->reason, "keyCompromise") ||
+ 0 == str::compareCI(m_impl->reason, "CACompromise"))
{
- result.push_back("compromise Date = " + String(m_impl->compromiseDate));
+ result.push_back("compromise Date = " + str::numstring(m_impl->compromiseDate));
}
return result;
@@ -337,33 +337,33 @@
// private:
// ----------------------------------------------------------------------------
-blocxx::String
-CRLReason::checkHoldInstruction(const String& hi) const
+std::string
+CRLReason::checkHoldInstruction(const std::string& hi) const
{
- if(!hi.equalsIgnoreCase("holdInstructionNone") &&
- !hi.equalsIgnoreCase("holdInstructionCallIssuer") &&
- !hi.equalsIgnoreCase("holdInstructionReject") &&
+ if(0 != str::compareCI(hi, "holdInstructionNone") &&
+ 0 != str::compareCI(hi, "holdInstructionCallIssuer") &&
+ 0 != str::compareCI(hi, "holdInstructionReject") &&
!initOIDCheck().isValid(hi)) {
- return (Format("Invalid holdInstruction: %1", hi).toString());
+ return (str::form("Invalid holdInstruction: %s", hi.c_str()));
}
- return String();
+ return std::string();
}
// ----------------------------------------------------------------------------
bool
-CRLReason::checkReason(const String& reason) const
+CRLReason::checkReason(const std::string& reason) const
{
- if(reason.equalsIgnoreCase("none") ||
- reason.equalsIgnoreCase("unspecified") ||
- reason.equalsIgnoreCase("keyCompromise") ||
- reason.equalsIgnoreCase("CACompromise") ||
- reason.equalsIgnoreCase("affiliationChanged") ||
- reason.equalsIgnoreCase("superseded") ||
- reason.equalsIgnoreCase("cessationOfOperation") ||
- reason.equalsIgnoreCase("certificateHold") ||
- reason.equalsIgnoreCase("removeFromCRL"))
+ if(0 == str::compareCI(reason, "none") ||
+ 0 == str::compareCI(reason, "unspecified") ||
+ 0 == str::compareCI(reason, "keyCompromise") ||
+ 0 == str::compareCI(reason, "CACompromise") ||
+ 0 == str::compareCI(reason, "affiliationChanged") ||
+ 0 == str::compareCI(reason, "superseded") ||
+ 0 == str::compareCI(reason, "cessationOfOperation") ||
+ 0 == str::compareCI(reason, "certificateHold") ||
+ 0 == str::compareCI(reason, "removeFromCRL"))
{
return true;
}
Modified: limal-branches/mc-devel/limal-ca-mgm/src/CRLReason_Priv.cpp
URL: http://svn.opensuse.org/viewcvs/limal/limal-branches/mc-devel/limal-ca-mgm/src/CRLReason_Priv.cpp?rev=2675&r1=2674&r2=2675&view=diff
==============================================================================
--- limal-branches/mc-devel/limal-ca-mgm/src/CRLReason_Priv.cpp (original)
+++ limal-branches/mc-devel/limal-ca-mgm/src/CRLReason_Priv.cpp Sat Jul 3 13:27:18 2010
@@ -53,7 +53,7 @@
X509_EXTENSION *xe = sk_X509_EXTENSION_value(stack, x);
int nid = 0;
- String valueString;
+ std::string valueString;
char *value;
char obj_tmp[80];
BIO *out;
@@ -67,9 +67,8 @@
X509V3_EXT_print(out, xe, 0, 1);
int n = BIO_get_mem_data(out, &value);
- valueString = String(value, n);
- valueString.ltrim();
- valueString.rtrim();
+ valueString = std::string(value, n);
+ valueString = str::trim(valueString);
BIO_free(out);
LOGIT_DEBUG("Value: " << valueString);
@@ -138,11 +137,11 @@
// e.g. Aug 18 15:56:46 2005 GMT
Date dtime(std::string(valueString.c_str()), "%B %d %H:%M:%S %Y %Z", true);
- if(getReason().equalsIgnoreCase("keyCompromise"))
+ if(0 == str::compareCI(getReason(), "keyCompromise"))
{
setKeyCompromiseDate(dtime);
}
- else if(getReason().equalsIgnoreCase("CACompromise"))
+ else if(0 == str::compareCI(getReason(), "CACompromise"))
{
setCACompromiseDate(dtime);
}
Modified: limal-branches/mc-devel/limal-ca-mgm/src/CertificateData.cpp
URL: http://svn.opensuse.org/viewcvs/limal/limal-branches/mc-devel/limal-ca-mgm/src/CertificateData.cpp?rev=2675&r1=2674&r2=2675&view=diff
==============================================================================
--- limal-branches/mc-devel/limal-ca-mgm/src/CertificateData.cpp (original)
+++ limal-branches/mc-devel/limal-ca-mgm/src/CertificateData.cpp Sat Jul 3 13:27:18 2010
@@ -60,7 +60,7 @@
return m_impl->version;
}
-blocxx::String
+std::string
CertificateData::getSerial() const
{
return m_impl->serial;
@@ -102,7 +102,7 @@
return m_impl->pubkeyAlgorithm;
}
-blocxx::String
+std::string
CertificateData::getPublicKeyAlgorithmAsString() const
{
switch(m_impl->pubkeyAlgorithm)
@@ -117,7 +117,7 @@
return "DH";
break;
}
- return String();
+ return std::string();
}
ByteBuffer
@@ -132,7 +132,7 @@
return m_impl->signatureAlgorithm;
}
-blocxx::String
+std::string
CertificateData::getSignatureAlgorithmAsString() const
{
switch(m_impl->signatureAlgorithm)
@@ -147,7 +147,7 @@
return "SHA1DSA";
break;
}
- return String();
+ return std::string();
}
ByteBuffer
@@ -156,7 +156,7 @@
return m_impl->signature;
}
-blocxx::String
+std::string
CertificateData::getFingerprint() const
{
return m_impl->fingerprint;
@@ -168,7 +168,7 @@
return m_impl->extensions;
}
-String
+std::string
CertificateData::getCertificateAsText() const
{
unsigned char *ustringval = NULL;
@@ -178,13 +178,13 @@
X509_print_ex(bio, m_impl->x509, 0, 0);
n = BIO_get_mem_data(bio, &ustringval);
- String text = String((const char*)ustringval, n);
+ std::string text = std::string((const char*)ustringval, n);
BIO_free(bio);
return text;
}
-String
+std::string
CertificateData::getExtensionsAsText() const
{
unsigned char *ustringval = NULL;
@@ -194,7 +194,7 @@
X509V3_extensions_print(bio, NULL, m_impl->x509->cert_info->extensions, 0, 4);
n = BIO_get_mem_data(bio, &ustringval);
- String extText = String((const char*)ustringval, n);
+ std::string extText = std::string((const char*)ustringval, n);
BIO_free(bio);
return extText;
@@ -243,28 +243,28 @@
return true;
}
-std::vectorblocxx::String
+std::vectorstd::string
CertificateData::verify() const
{
- std::vectorblocxx::String result;
+ std::vectorstd::string result;
if(m_impl->version < 1 || m_impl->version > 3)
{
- result.push_back(Format("invalid version: %1", m_impl->version).toString());
+ result.push_back(str::form("invalid version: %d", m_impl->version));
}
if(!initHexCheck().isValid(m_impl->serial))
{
- result.push_back(Format("invalid serial: %1", m_impl->serial).toString());
+ result.push_back(str::form("invalid serial: %s", m_impl->serial.c_str()));
}
if(m_impl->notBefore == 0)
{
- result.push_back(Format("invalid notBefore: %1", m_impl->notBefore).toString());
+ result.push_back(str::form("invalid notBefore: %ld", m_impl->notBefore));
}
if(m_impl->notAfter <= m_impl->notBefore)
{
- result.push_back(Format("invalid notAfter: %1", m_impl->notAfter).toString());
+ result.push_back(str::form("invalid notAfter: %ld", m_impl->notAfter));
}
appendArray(result, m_impl->issuer.verify());
appendArray(result, m_impl->subject.verify());
@@ -283,38 +283,34 @@
return result;
}
-std::vectorblocxx::String
+std::vectorstd::string
CertificateData::dump() const
{
- std::vectorblocxx::String result;
+ std::vectorstd::string result;
result.push_back("CertificateData::dump()");
- result.push_back("Version = " + String(m_impl->version));
+ result.push_back("Version = " + str::numstring(m_impl->version));
result.push_back("Serial = " + m_impl->serial);
- result.push_back("notBefore = " + String(m_impl->notBefore));
- result.push_back("notAfter = " + String(m_impl->notAfter));
+ result.push_back("notBefore = " + str::numstring(m_impl->notBefore));
+ result.push_back("notAfter = " + str::numstring(m_impl->notAfter));
result.push_back("Fingerprint = " + m_impl->fingerprint);
appendArray(result, m_impl->issuer.dump());
appendArray(result, m_impl->subject.dump());
- result.push_back("Keysize = " + String(m_impl->keysize));
- result.push_back("public key algorithm = " + String(m_impl->pubkeyAlgorithm));
+ result.push_back("Keysize = " + str::numstring(m_impl->keysize));
+ result.push_back("public key algorithm = " + str::numstring(m_impl->pubkeyAlgorithm));
- String pk;
+ std::string pk;
for(size_t i = 0; i < m_impl->publicKey.size(); ++i)
{
- String s;
- s.format("%02x", (UInt8)m_impl->publicKey[i]);
- pk += s + ":";
+ pk += str::form( "%02x", (UInt8)m_impl->publicKey[i] ) + ":";
}
result.push_back("public Key = " + pk);
- result.push_back("signatureAlgorithm = "+ String(m_impl->signatureAlgorithm));
+ result.push_back("signatureAlgorithm = "+ str::numstring(m_impl->signatureAlgorithm));
- String s;
+ std::string s;
for(uint i = 0; i < m_impl->signature.size(); ++i)
{
- String d;
- d.format("%02x:", (UInt8)m_impl->signature[i]);
- s += d;
+ s += str::form( "%02x", (UInt8)m_impl->signature[i] );
}
result.push_back("Signature = " + s);
Modified: limal-branches/mc-devel/limal-ca-mgm/src/CertificateDataImpl.hpp
URL: http://svn.opensuse.org/viewcvs/limal/limal-branches/mc-devel/limal-ca-mgm/src/CertificateDataImpl.hpp?rev=2675&r1=2674&r2=2675&view=diff
==============================================================================
--- limal-branches/mc-devel/limal-ca-mgm/src/CertificateDataImpl.hpp (original)
+++ limal-branches/mc-devel/limal-ca-mgm/src/CertificateDataImpl.hpp Sat Jul 3 13:27:18 2010
@@ -83,9 +83,9 @@
return new CertificateDataImpl(*this);
}
- uint32_t version; // allowed 1, 2, 3
- String serial;
- String fingerprint;
+ uint32_t version; // allowed 1, 2, 3
+ std::string serial;
+ std::string fingerprint;
time_t notBefore;
time_t notAfter;
Modified: limal-branches/mc-devel/limal-ca-mgm/src/CertificateData_Priv.cpp
URL: http://svn.opensuse.org/viewcvs/limal/limal-branches/mc-devel/limal-ca-mgm/src/CertificateData_Priv.cpp?rev=2675&r1=2674&r2=2675&view=diff
==============================================================================
--- limal-branches/mc-devel/limal-ca-mgm/src/CertificateData_Priv.cpp (original)
+++ limal-branches/mc-devel/limal-ca-mgm/src/CertificateData_Priv.cpp Sat Jul 3 13:27:18 2010
@@ -58,7 +58,7 @@
init(certificate, formatType);
}
-CertificateData_Priv::CertificateData_Priv(const String &certificatePath,
+CertificateData_Priv::CertificateData_Priv(const std::string &certificatePath,
FormatType formatType)
: CertificateData()
{
@@ -83,14 +83,14 @@
}
void
-CertificateData_Priv::setSerial(const String& serial)
+CertificateData_Priv::setSerial(const std::string& serial)
{
if(!initHexCheck().isValid(serial))
{
LOGIT_ERROR("invalid serial: " << serial);
BLOCXX_THROW(ca_mgm::ValueException,
// %1 is an invalid serial number
- Format(__("Invalid serial %1."), serial).c_str());
+ str::form(__("Invalid serial %s."), serial.c_str()).c_str());
}
m_impl->serial = serial;
}
@@ -105,7 +105,7 @@
void
CertificateData_Priv::setIssuerDN(const DNObject& issuer)
{
- std::vectorblocxx::String r = issuer.verify();
+ std::vectorstd::string r = issuer.verify();
if(!r.empty())
{
LOGIT_ERROR(r[0]);
@@ -117,7 +117,7 @@
void
CertificateData_Priv::setSubjectDN(const DNObject& subject)
{
- std::vectorblocxx::String r = subject.verify();
+ std::vectorstd::string r = subject.verify();
if(!r.empty())
{
LOGIT_ERROR(r[0]);
@@ -159,7 +159,7 @@
void
CertificateData_Priv::setExtensions(const X509v3CertificateExts& ext)
{
- std::vectorblocxx::String r = ext.verify();
+ std::vectorstd::string r = ext.verify();
if(!r.empty())
{
LOGIT_ERROR(r[0]);
@@ -169,7 +169,7 @@
}
void
-CertificateData_Priv::setFingerprint(const String& fp)
+CertificateData_Priv::setFingerprint(const std::string& fp)
{
m_impl->fingerprint = fp;
}
@@ -264,7 +264,7 @@
BIO *bioS = BIO_new(BIO_s_mem());
ASN1_INTEGER *bs=X509_get_serialNumber(x509);
- String serialStr;
+ std::string serialStr;
for (int i=0; i<bs->length; i++)
{
if (BIO_printf(bioS,"%02x",bs->data[i]) <= 0)
@@ -275,7 +275,7 @@
}
}
n = BIO_get_mem_data(bioS, &ustringval);
- setSerial( String(reinterpret_cast(ustringval), n).toUpperCase());
+ setSerial( str::toUpper(std::string(reinterpret_cast(ustringval), n)));
BIO_free(bioS);
// get notBefore
@@ -321,7 +321,7 @@
}
}
n = BIO_get_mem_data(bioFP, &ustringval);
- setFingerprint( String(reinterpret_cast(ustringval), n));
+ setFingerprint( std::string(reinterpret_cast(ustringval), n));
BIO_free(bioFP);
// get issuer
@@ -437,8 +437,8 @@
LOGIT_ERROR("Unsupported signature algorithm: '" << sbuf << "'");
BLOCXX_THROW(ca_mgm::RuntimeException,
- // %1 is the unsupported signature algorithm string
- Format(__("Unsupported signature algorithm %1."), sbuf).c_str());
+ // %s is the unsupported signature algorithm string
+ str::form(__("Unsupported signature algorithm %s."), sbuf.c_str()).c_str());
}
// get signature
Modified: limal-branches/mc-devel/limal-ca-mgm/src/CertificateData_Priv.hpp
URL: http://svn.opensuse.org/viewcvs/limal/limal-branches/mc-devel/limal-ca-mgm/src/CertificateData_Priv.hpp?rev=2675&r1=2674&r2=2675&view=diff
==============================================================================
--- limal-branches/mc-devel/limal-ca-mgm/src/CertificateData_Priv.hpp (original)
+++ limal-branches/mc-devel/limal-ca-mgm/src/CertificateData_Priv.hpp Sat Jul 3 13:27:18 2010
@@ -45,7 +45,7 @@
*
*
*/
- CertificateData_Priv(const String &certificatePath,
+ CertificateData_Priv(const std::string &certificatePath,
FormatType formatType = E_PEM);
CertificateData_Priv(const CertificateData_Priv& data);
@@ -56,7 +56,7 @@
setVersion(uint32_t v);
void
- setSerial(const String& serial);
+ setSerial(const std::string& serial);
void
setCertifyPeriode(time_t start, time_t end);
@@ -86,7 +86,7 @@
setExtensions(const X509v3CertificateExts& ext);
void
- setFingerprint(const String& fp);
+ setFingerprint(const std::string& fp);
private:
CertificateData_Priv& operator=(const CertificateData_Priv& data);
Modified: limal-branches/mc-devel/limal-ca-mgm/src/CertificateIssueData.cpp
URL: http://svn.opensuse.org/viewcvs/limal/limal-branches/mc-devel/limal-ca-mgm/src/CertificateIssueData.cpp?rev=2675&r1=2674&r2=2675&view=diff
==============================================================================
--- limal-branches/mc-devel/limal-ca-mgm/src/CertificateIssueData.cpp (original)
+++ limal-branches/mc-devel/limal-ca-mgm/src/CertificateIssueData.cpp Sat Jul 3 13:27:18 2010
@@ -81,21 +81,21 @@
{
m_impl->notBefore = Date::now();
- uint32_t days = caConfig->getValue(type2Section(type, false), "default_days").toUInt32();
+ uint32_t days = str::strtonum(caConfig->getValue(type2Section(type, false), "default_days"));
Date dt = Date(getStartDate());
dt += (days*24*60*60);
m_impl->notAfter = dt;
- String md = caConfig->getValue(type2Section(type, false), "default_md");
- if(md.equalsIgnoreCase("sha1"))
+ std::string md = caConfig->getValue(type2Section(type, false), "default_md");
+ if(0 == str::compareCI(md, "sha1"))
{
setMessageDigest( E_SHA1 );
}
- else if(md.equalsIgnoreCase("md5"))
+ else if(0 == str::compareCI(md, "md5"))
{
setMessageDigest( E_MD5 );
}
- else if(md.equalsIgnoreCase("mdc2"))
+ else if(0 == str::compareCI(md, "mdc2"))
{
setMessageDigest( E_MDC2 );
}
@@ -145,20 +145,20 @@
return m_impl->notAfter;
}
-blocxx::String
+std::string
CertificateIssueData::getStartDateAsString() const
{
Date dt(getStartDate());
- blocxx::String time(dt.form("%y%m%d%H%M%S", true) + "Z");
+ std::string time(dt.form("%y%m%d%H%M%S", true) + "Z");
return time;
}
-blocxx::String
+std::string
CertificateIssueData::getEndDateAsString() const
{
Date dt(getEndDate());
- blocxx::String time(dt.form("%y%m%d%H%M%S", true) + "Z");
+ std::string time(dt.form("%y%m%d%H%M%S", true) + "Z");
return time;
}
@@ -178,7 +178,7 @@
void
CertificateIssueData::setExtensions(const X509v3CertificateIssueExts& ext)
{
- std::vectorblocxx::String r = ext.verify();
+ std::vectorstd::string r = ext.verify();
if(!r.empty())
{
LOGIT_ERROR(r[0]);
@@ -214,13 +214,13 @@
{
LOGIT_ERROR("wrong type" << type);
BLOCXX_THROW(ca_mgm::ValueException,
- Format(__("Wrong type: %1."), type).c_str());
+ str::form(__("Wrong type: %d."), type).c_str());
}
uint32_t t = (uint32_t)((getEndDate() - getStartDate())/(60*60*24));
- ca.getConfig()->setValue(type2Section(type, false), "default_days", String(t));
+ ca.getConfig()->setValue(type2Section(type, false), "default_days", str::numstring(t));
- String md("sha1");
+ std::string md("sha1");
switch(getMessageDigest())
{
case E_SHA1:
@@ -258,20 +258,19 @@
return true;
}
-std::vectorblocxx::String
+std::vectorstd::string
CertificateIssueData::verify() const
{
- std::vectorblocxx::String result;
+ std::vectorstd::string result;
if(getStartDate() == 0)
{
- result.push_back(Format("invalid notBefore: %1", getStartDate()).toString());
+ result.push_back(str::form("invalid notBefore: %ld", getStartDate()));
}
if(getEndDate() <= getStartDate())
{
- result.push_back(Format("invalid notAfter %1 <= notBefore %2",
- getEndDate(), getStartDate())
- .toString());
+ result.push_back(str::form("invalid notAfter %ld <= notBefore %ld",
+ getEndDate(), getStartDate()));
}
appendArray(result, m_impl->extensions.verify());
@@ -281,17 +280,17 @@
return result;
}
-std::vectorblocxx::String
+std::vectorstd::string
CertificateIssueData::dump() const
{
- std::vectorblocxx::String result;
+ std::vectorstd::string result;
result.push_back("CertificateIssueData::dump()");
- result.push_back("!CHANGING DATA! notBefore = " + String(getStartDate()));
- result.push_back("!CHANGING DATA! notAfter = " + String(getEndDate()));
+ result.push_back("!CHANGING DATA! notBefore = " + str::numstring(getStartDate()));
+ result.push_back("!CHANGING DATA! notAfter = " + str::numstring(getEndDate()));
result.push_back("notAfter - notBefore (in days)= " +
- String((getEndDate() - getStartDate())/86400));
- result.push_back("MessageDigest = " + String(getMessageDigest()));
+ str::numstring((getEndDate() - getStartDate())/86400));
+ result.push_back("MessageDigest = " + str::numstring(getMessageDigest()));
appendArray(result, getExtensions().dump());
return result;
Modified: limal-branches/mc-devel/limal-ca-mgm/src/CertificatePoliciesExtension.cpp
URL: http://svn.opensuse.org/viewcvs/limal/limal-branches/mc-devel/limal-ca-mgm/src/CertificatePoliciesExtension.cpp?rev=2675&r1=2674&r2=2675&view=diff
==============================================================================
--- limal-branches/mc-devel/limal-ca-mgm/src/CertificatePoliciesExtension.cpp (original)
+++ limal-branches/mc-devel/limal-ca-mgm/src/CertificatePoliciesExtension.cpp Sat Jul 3 13:27:18 2010
@@ -57,12 +57,12 @@
return new UserNoticeImpl(*this);
}
- String explicitText; // max 200 characters
+ std::string explicitText; // max 200 characters
// The organization and noticeNumbers options
// (if included) must BOTH be present.
- String organization; // max 200 characters
+ std::string organization; // max 200 characters
std::list noticeNumbers;
};
@@ -72,12 +72,12 @@
public:
CertificatePolicyImpl()
- : policyIdentifier(String())
+ : policyIdentifier(std::string())
, cpsURI(StringList())
, noticeList(std::list<UserNotice>())
{}
- CertificatePolicyImpl(const String &policyIdentifier)
+ CertificatePolicyImpl(const std::string &policyIdentifier)
: policyIdentifier(policyIdentifier)
, cpsURI(StringList())
, noticeList(std::list<UserNotice>())
@@ -97,7 +97,7 @@
return new CertificatePolicyImpl(*this);
}
- String policyIdentifier; // required
+ std::string policyIdentifier; // required
StringList cpsURI; // Certification Practice Statement
std::list<UserNotice> noticeList;
@@ -156,7 +156,7 @@
}
void
-UserNotice::initWithSection(CAConfig* caConfig, Type type, const String& sectionName)
+UserNotice::initWithSection(CAConfig* caConfig, Type type, const std::string& sectionName)
{
// These types are not supported by this object
if(type == E_CRL || type == E_Client_Req ||
@@ -164,7 +164,7 @@
{
LOGIT_ERROR("wrong type" << type);
BLOCXX_THROW(ca_mgm::ValueException,
- Format(__("Wrong type: %1."), type).c_str());
+ str::form(__("Wrong type: %1."), type).c_str());
}
bool p = caConfig->exists(sectionName, "explicitText");
@@ -190,12 +190,12 @@
p = caConfig->exists(sectionName, "noticeNumbers");
if(p)
{
- std::vectorblocxx::String a = convStringArray(PerlRegEx(",").
- split(caConfig->getValue(sectionName, "noticeNumbers")));
- std::vectorblocxx::String::const_iterator it = a.begin();
+ std::vectorstd::string a = PerlRegEx(",").
+ split(caConfig->getValue(sectionName, "noticeNumbers"));
+ std::vectorstd::string::const_iterator it = a.begin();
for(; it != a.end(); ++it)
{
- m_impl->noticeNumbers.push_back((*it).toInt32());
+ m_impl->noticeNumbers.push_back(str::strtonum(*it));
}
}
else
@@ -205,7 +205,7 @@
}
void
-UserNotice::setExplicitText(const String& text)
+UserNotice::setExplicitText(const std::string& text)
{
if(text.length() > 200)
{
@@ -217,21 +217,21 @@
m_impl->explicitText = text;
}
-blocxx::String
+std::string
UserNotice::getExplicitText() const
{
return m_impl->explicitText;
}
void
-UserNotice::setOrganizationNotice(const String& org,
+UserNotice::setOrganizationNotice(const std::string& org,
const std::list& numbers)
{
m_impl->organization = org;
m_impl->noticeNumbers = numbers;
}
-blocxx::String
+std::string
UserNotice::getOrganization() const
{
return m_impl->organization;
@@ -243,7 +243,7 @@
return m_impl->noticeNumbers;
}
-blocxx::String
+std::string
UserNotice::commit2Config(CA& ca, Type type, uint32_t num) const
{
if(!valid())
@@ -259,11 +259,11 @@
{
LOGIT_ERROR("wrong type" << type);
BLOCXX_THROW(ca_mgm::ValueException,
- Format(__("Wrong type: %1."), type).c_str());
+ str::form(__("Wrong type: %1."), type).c_str());
}
// we need a User Notice section
- String sectionName = String("notice")+type2Section(type, true)+String(num);
+ std::string sectionName = std::string("notice")+type2Section(type, true)+str::numstring(num);
if(!m_impl->explicitText.empty())
{
@@ -274,11 +274,11 @@
{
ca.getConfig()->setValue(sectionName, "organization", m_impl->organization);
- String numbers;
+ std::string numbers;
std::list::const_iterator it = m_impl->noticeNumbers.begin();
for(;it != m_impl->noticeNumbers.end(); ++it)
{
- numbers += String(*it)+",";
+ numbers += str::numstring(*it)+",";
}
ca.getConfig()->setValue(sectionName, "noticeNumbers",
numbers.erase(numbers.length()-1));
@@ -304,10 +304,10 @@
return true;
}
-std::vectorblocxx::String
+std::vectorstd::string
UserNotice::verify() const
{
- std::vectorblocxx::String result;
+ std::vectorstd::string result;
if(m_impl->explicitText.length() > 200)
{
@@ -323,20 +323,20 @@
return result;
}
-std::vectorblocxx::String
+std::vectorstd::string
UserNotice::dump() const
{
- std::vectorblocxx::String result;
+ std::vectorstd::string result;
result.push_back("UserNotice::dump()");
result.push_back("explicitText = "+ m_impl->explicitText);
result.push_back("organization = " + m_impl->organization);
- String n;
+ std::string n;
std::list< int32_t >::const_iterator it = m_impl->noticeNumbers.begin();
for(; it != m_impl->noticeNumbers.end(); ++it)
{
- n += String(*it) + " ";
+ n += str::numstring(*it) + " ";
}
result.push_back("noticeNumbers = " + n);
@@ -382,15 +382,15 @@
: m_impl(new CertificatePolicyImpl())
{}
-CertificatePolicy::CertificatePolicy(const String& policyIdentifier)
+CertificatePolicy::CertificatePolicy(const std::string& policyIdentifier)
: m_impl(new CertificatePolicyImpl(policyIdentifier))
{
if(!initOIDCheck().isValid(policyIdentifier))
{
LOGIT_ERROR("invalid value for policyIdentifier" << policyIdentifier);
BLOCXX_THROW(ca_mgm::ValueException ,
- // %1 is the wrong string for policyIdentifier
- Format(__("Invalid value for policyIdentifier: %1."), policyIdentifier).c_str());
+ // %s is the wrong string for policyIdentifier
+ str::form(__("Invalid value for policyIdentifier: %s."), policyIdentifier.c_str()).c_str());
}
}
@@ -412,7 +412,7 @@
}
void
-CertificatePolicy::initWithSection(CAConfig* caConfig, Type type, const String& sectionName)
+CertificatePolicy::initWithSection(CAConfig* caConfig, Type type, const std::string& sectionName)
{
// These types are not supported by this object
if(type == E_CRL || type == E_Client_Req ||
@@ -420,7 +420,7 @@
{
LOGIT_ERROR("wrong type" << type);
BLOCXX_THROW(ca_mgm::ValueException,
- Format(__("Wrong type: %1."), type).c_str());
+ str::form(__("Wrong type: %1."), type).c_str());
}
bool p = caConfig->exists(sectionName, "policyIdentifier");
@@ -433,34 +433,34 @@
StringList::const_iterator it = kl.begin();
for(; it != kl.end(); ++it)
{
- if((*it).startsWith("CPS", String::E_CASE_INSENSITIVE))
+ if(str::startsWith(*it,"CPS"))
{
m_impl->cpsURI.push_back(caConfig->getValue(sectionName, *it));
}
- else if((*it).startsWith("userNotice", String::E_CASE_INSENSITIVE))
+ else if(str::startsWith(*it, "userNotice"))
{
- String uns = caConfig->getValue(sectionName, *it);
+ std::string uns = caConfig->getValue(sectionName, *it);
UserNotice un = UserNotice();
- un.initWithSection(caConfig, type, uns.substring(1));
+ un.initWithSection(caConfig, type, uns.substr(1));
m_impl->noticeList.push_back(un);
}
}
}
void
-CertificatePolicy::setPolicyIdentifier(const String& policyIdentifier)
+CertificatePolicy::setPolicyIdentifier(const std::string& policyIdentifier)
{
if(!initOIDCheck().isValid(policyIdentifier))
{
LOGIT_ERROR("invalid value for policyIdentifier" << policyIdentifier);
BLOCXX_THROW(ca_mgm::ValueException,
- Format(__("Invalid value for policyIdentifier: %1."), policyIdentifier).c_str());
+ str::form(__("Invalid value for policyIdentifier: %s."), policyIdentifier.c_str()).c_str());
}
m_impl->policyIdentifier = policyIdentifier;
}
-blocxx::String
+std::string
CertificatePolicy::getPolicyIdentifier() const
{
return m_impl->policyIdentifier;
@@ -469,7 +469,7 @@
void
CertificatePolicy::setCpsURI(const StringList& cpsURI)
{
- std::vectorblocxx::String r = checkCpsURIs(cpsURI);
+ std::vectorstd::string r = checkCpsURIs(cpsURI);
if(!r.empty())
{
LOGIT_ERROR(r[0]);
@@ -487,7 +487,7 @@
void
CertificatePolicy::setUserNoticeList(const std::list<UserNotice>& list)
{
- std::vectorblocxx::String r = checkNoticeList(list);
+ std::vectorstd::string r = checkNoticeList(list);
if(!r.empty())
{
LOGIT_ERROR(r[0]);
@@ -502,7 +502,7 @@
return m_impl->noticeList;
}
-blocxx::String
+std::string
CertificatePolicy::commit2Config(CA& ca, Type type, uint32_t num) const
{
if(!valid())
@@ -518,7 +518,7 @@
{
LOGIT_ERROR("wrong type" << type);
BLOCXX_THROW(ca_mgm::ValueException,
- Format(__("Wrong type: %1."), type).c_str());
+ str::form(__("Wrong type: %1."), type).c_str());
}
if(m_impl->cpsURI.empty()) {
@@ -526,21 +526,21 @@
return m_impl->policyIdentifier;
}
// we need a policy section
- String sectionName = String("polsec")+type2Section(type, true)+String(num);
+ std::string sectionName = std::string("polsec")+type2Section(type, true)+str::numstring(num);
ca.getConfig()->setValue(sectionName, "policyIdentifier", m_impl->policyIdentifier);
StringList::const_iterator it = m_impl->cpsURI.begin();
for(uint32_t i = 1;it != m_impl->cpsURI.end(); ++it, ++i)
{
- ca.getConfig()->setValue(sectionName, "CPS."+String(i),(*it));
+ ca.getConfig()->setValue(sectionName, "CPS."+str::numstring(i),(*it));
}
std::list<UserNotice>::const_iterator nit = m_impl->noticeList.begin();
for(uint32_t j = 1;nit != m_impl->noticeList.end(); ++nit, ++j)
{
- String n = (*nit).commit2Config(ca, type, j);
- ca.getConfig()->setValue(sectionName, "userNotice."+String(j),n);
+ std::string n = (*nit).commit2Config(ca, type, j);
+ ca.getConfig()->setValue(sectionName, "userNotice."+str::numstring(j),n);
}
return ("@"+sectionName);
@@ -556,7 +556,7 @@
return false;
}
- std::vectorblocxx::String r = checkCpsURIs(m_impl->cpsURI);
+ std::vectorstd::string r = checkCpsURIs(m_impl->cpsURI);
if(!r.empty())
{
LOGIT_DEBUG(r[0]);
@@ -572,18 +572,18 @@
return true;
}
-std::vectorblocxx::String
+std::vectorstd::string
CertificatePolicy::verify() const
{
- std::vectorblocxx::String result;
+ std::vectorstd::string result;
ValueCheck oidCheck = initOIDCheck();
if(m_impl->policyIdentifier.empty() ||
!oidCheck.isValid(m_impl->policyIdentifier))
{
- result.push_back(Format("invalid value for policyIdentifier: %1",
- m_impl->policyIdentifier).toString());
+ result.push_back(str::form("invalid value for policyIdentifier: %s",
+ m_impl->policyIdentifier.c_str()));
}
appendArray(result, checkCpsURIs(m_impl->cpsURI));
@@ -594,10 +594,10 @@
return result;
}
-std::vectorblocxx::String
+std::vectorstd::string
CertificatePolicy::dump() const
{
- std::vectorblocxx::String result;
+ std::vectorstd::string result;
result.push_back("CertificatePolicy::dump()");
result.push_back("policy Identifier = " + m_impl->policyIdentifier);
@@ -648,10 +648,10 @@
}
}
-std::vectorblocxx::String
+std::vectorstd::string
CertificatePolicy::checkCpsURIs(const StringList& cpsURIs) const
{
- std::vectorblocxx::String result;
+ std::vectorstd::string result;
ValueCheck uriCheck = initURICheck();
StringList::const_iterator it = cpsURIs.begin();
@@ -659,16 +659,16 @@
{
if(!uriCheck.isValid(*it))
{
- result.push_back(Format("invalid URI: %1", *it).toString());
+ result.push_back(str::form("invalid URI: %s", (*it).c_str()));
}
}
return result;
}
-std::vectorblocxx::String
+std::vectorstd::string
CertificatePolicy::checkNoticeList(const std::list<UserNotice>& list) const
{
- std::vectorblocxx::String result;
+ std::vectorstd::string result;
std::list<UserNotice>::const_iterator it = list.begin();
for(;it != list.end(); it++)
{
@@ -689,7 +689,7 @@
: ExtensionBase()
, m_impl(new CertificatePoliciesExtImpl(policies))
{
- std::vectorblocxx::String r = checkPolicies(policies);
+ std::vectorstd::string r = checkPolicies(policies);
if(!r.empty())
{
LOGIT_ERROR(r[0]);
@@ -708,26 +708,26 @@
{
LOGIT_ERROR("wrong type" << type);
BLOCXX_THROW(ca_mgm::ValueException,
- Format(__("Wrong type: %1."), type).c_str());
+ str::form(__("Wrong type: %1."), type).c_str());
}
bool p = caConfig->exists(type2Section(type, true), "certificatePolicies");
if(p)
{
ValueCheck check = initOIDCheck();
- std::vectorblocxx::String sp = convStringArray(PerlRegEx("\\s*,\\s*")
- .split(caConfig->getValue(type2Section(type, true), "certificatePolicies")));
+ std::vectorstd::string sp = PerlRegEx("\\s*,\\s*")
+ .split(caConfig->getValue(type2Section(type, true), "certificatePolicies"));
- if(sp[0].equalsIgnoreCase("critical"))
+ if(0 == str::compareCI(sp[0], "critical"))
{
setCritical(true);
sp.erase(sp.begin());
}
- std::vectorblocxx::String::const_iterator it = sp.begin();
+ std::vectorstd::string::const_iterator it = sp.begin();
for(; it != sp.end(); ++it)
{
- if((*it).equalsIgnoreCase("ia5org"))
+ if(0 == str::compareCI(*it, "ia5org"))
{
m_impl->ia5org = true;
}
@@ -735,10 +735,10 @@
{
m_impl->policies.push_back(CertificatePolicy(*it));
}
- else if((*it).startsWith("@"))
+ else if(str::startsWith(*it, "@"))
{
CertificatePolicy cp = CertificatePolicy();
- cp.initWithSection(caConfig, type, (*it).substring(1));
+ cp.initWithSection(caConfig, type, (*it).substr(1));
m_impl->policies.push_back(cp);
}
}
@@ -786,7 +786,7 @@
void
CertificatePoliciesExt::setPolicies(const std::list<CertificatePolicy>& policies)
{
- std::vectorblocxx::String r = checkPolicies(policies);
+ std::vectorstd::string r = checkPolicies(policies);
if(!r.empty())
{
LOGIT_ERROR(r[0]);
@@ -825,12 +825,12 @@
{
LOGIT_ERROR("wrong type" << type);
BLOCXX_THROW(ca_mgm::ValueException,
- Format(__("Wrong type: %1."), type).c_str());
+ str::form(__("Wrong type: %1."), type).c_str());
}
if(isPresent())
{
- String extString;
+ std::string extString;
if(isCritical()) extString += "critical,";
@@ -861,7 +861,7 @@
LOGIT_DEBUG("No policy set");
return false;
}
- std::vectorblocxx::String r = checkPolicies(m_impl->policies);
+ std::vectorstd::string r = checkPolicies(m_impl->policies);
if(!r.empty())
{
LOGIT_DEBUG(r[0]);
@@ -870,10 +870,10 @@
return true;
}
-std::vectorblocxx::String
+std::vectorstd::string
CertificatePoliciesExt::verify() const
{
- std::vectorblocxx::String result;
+ std::vectorstd::string result;
if(!isPresent()) return result;
@@ -888,16 +888,16 @@
return result;
}
-std::vectorblocxx::String
+std::vectorstd::string
CertificatePoliciesExt::dump() const
{
- std::vectorblocxx::String result;
+ std::vectorstd::string result;
result.push_back("CertificatePoliciesExt::dump()");
appendArray(result, ExtensionBase::dump());
if(!isPresent()) return result;
- result.push_back("ia5org = " + blocxx::Bool(m_impl->ia5org).toString());
+ result.push_back("ia5org = " + str::toString(m_impl->ia5org));
std::list< CertificatePolicy >::const_iterator it = m_impl->policies.begin();
for(; it != m_impl->policies.end(); ++it)
{
@@ -908,10 +908,10 @@
}
-std::vectorblocxx::String
+std::vectorstd::string
CertificatePoliciesExt::checkPolicies(const std::list<CertificatePolicy>& pl) const
{
- std::vectorblocxx::String result;
+ std::vectorstd::string result;
std::list<CertificatePolicy>::const_iterator it = pl.begin();
for(;it != pl.end(); it++)
{
Modified: limal-branches/mc-devel/limal-ca-mgm/src/Commands.hpp.in
URL: http://svn.opensuse.org/viewcvs/limal/limal-branches/mc-devel/limal-ca-mgm/src/Commands.hpp.in?rev=2675&r1=2674&r2=2675&view=diff
==============================================================================
--- limal-branches/mc-devel/limal-ca-mgm/src/Commands.hpp.in (original)
+++ limal-branches/mc-devel/limal-ca-mgm/src/Commands.hpp.in Sat Jul 3 13:27:18 2010
@@ -26,14 +26,14 @@
#define LIMAL_CA_MGM_COMMANDS_HPP
#include
-#include
+#include
namespace CA_MGM_NAMESPACE {
-const blocxx::String OPENSSL_COMMAND = "@OPENSSL_COMMAND@";
-const blocxx::String C_REHASH_COMMAND = "@C_REHASH_COMMAND@";
-const blocxx::String CP_COMMAND = "@CP_COMMAND@";
-const blocxx::String RM_COMMAND = "@RM_COMMAND@";
+const std::string OPENSSL_COMMAND = "@OPENSSL_COMMAND@";
+const std::string C_REHASH_COMMAND = "@C_REHASH_COMMAND@";
+const std::string CP_COMMAND = "@CP_COMMAND@";
+const std::string RM_COMMAND = "@RM_COMMAND@";
}
#endif /* LIMAL_CA_MGM_COMMANDS_HPP */
Modified: limal-branches/mc-devel/limal-ca-mgm/src/DNObject.cpp
URL: http://svn.opensuse.org/viewcvs/limal/limal-branches/mc-devel/limal-ca-mgm/src/DNObject.cpp?rev=2675&r1=2674&r2=2675&view=diff
==============================================================================
--- limal-branches/mc-devel/limal-ca-mgm/src/DNObject.cpp (original)
+++ limal-branches/mc-devel/limal-ca-mgm/src/DNObject.cpp Sat Jul 3 13:27:18 2010
@@ -61,30 +61,30 @@
}
void
-RDNObject::setRDNValue(const String& value)
+RDNObject::setRDNValue(const std::string& value)
{
m_impl->value = value;
}
-blocxx::String
+std::string
RDNObject::getType() const
{
return m_impl->type;
}
-blocxx::String
+std::string
RDNObject::getValue() const
{
return m_impl->value;
}
-blocxx::String
+std::string
RDNObject::getOpenSSLValue() const
{
- if(m_impl->value.empty()) return String();
+ if(m_impl->value.empty()) return std::string();
- std::map opensslKeys;
+ std::map opensslKeys;
opensslKeys["countryName"] = "C";
opensslKeys["stateOrProvinceName"] = "ST";
opensslKeys["localityName"] = "L";
@@ -94,8 +94,8 @@
opensslKeys["emailAddress"] = "emailAddress";
//opensslKeys[""] = "";
- String ret;
- std::map::const_iterator it = opensslKeys.find(m_impl->type);
+ std::string ret;
+ std::map::const_iterator it = opensslKeys.find(m_impl->type);
if( it != opensslKeys.end())
{
@@ -105,12 +105,12 @@
{
LOGIT_ERROR("Invalid type:" << m_impl->type);
BLOCXX_THROW(ca_mgm::ValueException,
- // %1 is the invalid string for a DN type
- Format(__("Invalid type %1."), m_impl->type).c_str());
+ // %s is the invalid string for a DN type
+ str::form(__("Invalid type %s."), m_impl->type.c_str()).c_str());
}
PerlRegEx regex("([\\\\/])");
- String v = regex.replace(m_impl->value, "\\\\\\1", true);
+ std::string v = regex.replace(m_impl->value, "\\\\\\1", true);
ret += v;
@@ -125,16 +125,16 @@
LOGIT_DEBUG("type is empty");
return false;
}
-
- if(m_impl->min != 0 && m_impl->value.UTF8Length() < m_impl->min)
+ // was UTF8Length
+ if(m_impl->min != 0 && m_impl->value.size() < m_impl->min)
{
LOGIT_DEBUG("value(" << m_impl->value <<
") is too small. Value has to be a minimal length of " <<
m_impl->min);
return false;
}
-
- if(m_impl->max != 0 && m_impl->value.UTF8Length() > m_impl->max)
+ // was UTF8Length
+ if(m_impl->max != 0 && m_impl->value.size() > m_impl->max)
{
LOGIT_DEBUG("value(" << m_impl->value <<
") is too long. Value has to be a maximal length of " <<
@@ -145,28 +145,30 @@
return true;
}
-std::vectorblocxx::String
+std::vectorstd::string
RDNObject::verify() const
{
- std::vectorblocxx::String result;
+ std::vectorstd::string result;
if(m_impl->type.empty())
{
result.push_back("type is empty");
}
- if(m_impl->min != 0 && m_impl->value.UTF8Length() < m_impl->min)
+ // was UTF8Length
+ if(m_impl->min != 0 && m_impl->value.size() < m_impl->min)
{
result.push_back("Value(" + m_impl->value +
") is too small. Value has to be a minimal length of " +
- String(m_impl->min));
+ str::numstring(m_impl->min));
}
- if(m_impl->max != 0 && m_impl->value.UTF8Length() > m_impl->max)
+ // was UTF8Length
+ if(m_impl->max != 0 && m_impl->value.size() > m_impl->max)
{
result.push_back("Value(" + m_impl->value +
") is too long. Value has to be a maximal length of " +
- String(m_impl->max));
+ str::numstring(m_impl->max));
}
LOGIT_DEBUG_STRINGARRAY("RDNObject::verify()", result);
@@ -174,16 +176,16 @@
return result;
}
-std::vectorblocxx::String
+std::vectorstd::string
RDNObject::dump() const
{
- std::vectorblocxx::String result;
+ std::vectorstd::string result;
result.push_back("RDNObject::dump()");
result.push_back(m_impl->type + "=" + m_impl->value);
result.push_back("Prompt:" + m_impl->prompt);
- result.push_back("Min:" + String(m_impl->min));
- result.push_back("Max:" + String(m_impl->max));
+ result.push_back("Min:" + str::numstring(m_impl->min));
+ result.push_back("Max:" + str::numstring(m_impl->max));
return result;
}
@@ -246,7 +248,7 @@
{
LOGIT_ERROR("wrong type" << type);
BLOCXX_THROW(ca_mgm::ValueException,
- Format(__("Wrong type: %1."), type).c_str());
+ str::form(__("Wrong type: %d."), type).c_str());
}
bool p = caConfig->exists(type2Section(type, false), "distinguished_name");
@@ -256,7 +258,7 @@
BLOCXX_THROW(ca_mgm::SyntaxException,
__("Missing section 'distinguished_name' in the configuration file."));
}
- String dnSect = caConfig->getValue(type2Section(type, false),
+ std::string dnSect = caConfig->getValue(type2Section(type, false),
"distinguished_name");
StringList dnKeys = caConfig->getKeylist(dnSect);
@@ -265,21 +267,21 @@
{
LOGIT_ERROR("Can not parse Section " << dnSect);
BLOCXX_THROW(ca_mgm::SyntaxException,
- Format(__("Cannot parse section %1."), dnSect).c_str());
+ str::form(__("Cannot parse section %s."), dnSect.c_str()).c_str());
}
StringList::const_iterator it = dnKeys.begin();
- String fieldName;
- String prompt;
- String defaultValue;
- String min("0");
- String max("0");
+ std::string fieldName;
+ std::string prompt;
+ std::string defaultValue;
+ std::string min("0");
+ std::string max("0");
for(; it != dnKeys.end(); ++it)
{
- if((*it).endsWith("_default", String::E_CASE_INSENSITIVE))
+ if(str::endsWithCI(*it, "_default"))
{
- if((*it).startsWith(fieldName, String::E_CASE_INSENSITIVE))
+ if(str::startsWithCI(*it, fieldName))
{
defaultValue = caConfig->getValue(dnSect, *it);
}
@@ -292,9 +294,9 @@
continue;
}
}
- else if((*it).endsWith("_min", String::E_CASE_INSENSITIVE))
+ else if(str::endsWithCI(*it, "_min"))
{
- if((*it).startsWith(fieldName, String::E_CASE_INSENSITIVE))
+ if(str::startsWithCI(*it, fieldName))
{
min = caConfig->getValue(dnSect, *it);
}
@@ -307,9 +309,9 @@
continue;
}
}
- else if((*it).endsWith("_max", String::E_CASE_INSENSITIVE))
+ else if(str::endsWithCI(*it, "_max"))
{
- if((*it).startsWith(fieldName, String::E_CASE_INSENSITIVE))
+ if(str::startsWithCI(*it, fieldName))
{
max = caConfig->getValue(dnSect, *it);
}
@@ -332,15 +334,15 @@
m_impl->dn.push_back(RDNObject_Priv(fieldName,
defaultValue,
prompt,
- min.toUInt32(),
- max.toUInt32()));
+ str::strtonum(min),
+ str::strtonum(max)));
}
// reset
- prompt = String();
- defaultValue = String();
- min = String("0");
- max = String("0");
+ prompt = std::string();
+ defaultValue = std::string();
+ min = std::string("0");
+ max = std::string("0");
fieldName = *it;
prompt = caConfig->getValue(dnSect, *it);
@@ -352,8 +354,8 @@
m_impl->dn.push_back(RDNObject_Priv(fieldName,
defaultValue,
prompt,
- min.toUInt32(),
- max.toUInt32()));
+ str::strtonum(min),
+ str::strtonum(max)));
}
}
@@ -361,7 +363,7 @@
: m_impl(new DNObjectImpl())
{
m_impl->dn = dn;
- std::vectorblocxx::String r = this->verify();
+ std::vectorstd::string r = this->verify();
if(!r.empty())
{
BLOCXX_THROW(ca_mgm::ValueException, r[0].c_str());
@@ -388,7 +390,7 @@
void
DNObject::setDN(const std::list<RDNObject> &dn)
{
- std::vectorblocxx::String r = checkRDNList(dn);
+ std::vectorstd::string r = checkRDNList(dn);
if(!r.empty())
{
LOGIT_ERROR(r[0]);
@@ -403,10 +405,10 @@
return m_impl->dn;
}
-blocxx::String
+std::string
DNObject::getOpenSSLString() const
{
- String ret;
+ std::string ret;
std::list<RDNObject>::const_iterator it = m_impl->dn.begin();
for(; it != m_impl->dn.end(); ++it)
@@ -428,7 +430,7 @@
LOGIT_DEBUG("empty DN");
return false;
}
- std::vectorblocxx::String r = checkRDNList(m_impl->dn);
+ std::vectorstd::string r = checkRDNList(m_impl->dn);
if(!r.empty())
{
LOGIT_DEBUG(r[0]);
@@ -437,10 +439,10 @@
return true;
}
-std::vectorblocxx::String
+std::vectorstd::string
DNObject::verify() const
{
- std::vectorblocxx::String result;
+ std::vectorstd::string result;
if(m_impl->dn.empty())
{
@@ -453,10 +455,10 @@
return result;
}
-std::vectorblocxx::String
+std::vectorstd::string
DNObject::checkRDNList(const std::list<RDNObject>& list) const
{
- std::vectorblocxx::String result;
+ std::vectorstd::string result;
std::list<RDNObject>::const_iterator it = list.begin();
for(; it != list.end(); ++it)
@@ -466,10 +468,10 @@
return result;
}
-std::vectorblocxx::String
+std::vectorstd::string
DNObject::dump() const
{
- std::vectorblocxx::String result;
+ std::vectorstd::string result;
result.push_back("DNObject::dump()");
std::list< RDNObject >::const_iterator it = m_impl->dn.begin();
Modified: limal-branches/mc-devel/limal-ca-mgm/src/DNObjectImpl.hpp
URL: http://svn.opensuse.org/viewcvs/limal/limal-branches/mc-devel/limal-ca-mgm/src/DNObjectImpl.hpp?rev=2675&r1=2674&r2=2675&view=diff
==============================================================================
--- limal-branches/mc-devel/limal-ca-mgm/src/DNObjectImpl.hpp (original)
+++ limal-branches/mc-devel/limal-ca-mgm/src/DNObjectImpl.hpp Sat Jul 3 13:27:18 2010
@@ -34,9 +34,9 @@
{
public:
RDNObjectImpl()
- : type(String())
- , value(String())
- , prompt(String())
+ : type(std::string())
+ , value(std::string())
+ , prompt(std::string())
, min(0)
, max(0)
{}
@@ -57,10 +57,10 @@
return new RDNObjectImpl(*this);
}
- blocxx::String type;
- blocxx::String value;
+ std::string type;
+ std::string value;
- blocxx::String prompt;
+ std::string prompt;
uint32_t min;
uint32_t max;
};
Modified: limal-branches/mc-devel/limal-ca-mgm/src/DNObject_Priv.cpp
URL: http://svn.opensuse.org/viewcvs/limal/limal-branches/mc-devel/limal-ca-mgm/src/DNObject_Priv.cpp?rev=2675&r1=2674&r2=2675&view=diff
==============================================================================
--- limal-branches/mc-devel/limal-ca-mgm/src/DNObject_Priv.cpp (original)
+++ limal-branches/mc-devel/limal-ca-mgm/src/DNObject_Priv.cpp Sat Jul 3 13:27:18 2010
@@ -36,8 +36,8 @@
: RDNObject()
{}
-RDNObject_Priv::RDNObject_Priv(const String& type, const String& value,
- const String& prompt,
+RDNObject_Priv::RDNObject_Priv(const std::string& type, const std::string& value,
+ const std::string& prompt,
uint32_t min,
uint32_t max)
: RDNObject()
@@ -53,8 +53,8 @@
{}
void
- RDNObject_Priv::setRDN(const String& type, const String& value,
- const String& prompt,
+ RDNObject_Priv::setRDN(const std::string& type, const std::string& value,
+ const std::string& prompt,
uint32_t min,
uint32_t max)
{
@@ -95,16 +95,17 @@
int n = BIO_get_mem_data(bio, &d);
- String name(d, n);
+ std::string name(d, n);
PerlRegEx re("(^[\\w]+)\\s=\\s(.+)$");
- StringArray lines = name.tokenize("\n");
+ std::vectorstd::string lines;
+ str::split(name, std::back_inserter(lines), "\n");
/*
* This is one option.
*
for(uint j = 0 ; j < lines.size(); ++j) {
- std::vectorblocxx::String vals = re.capture(lines[j]);
+ std::vectorstd::string vals = re.capture(lines[j]);
if(vals.size() != 3) {
@@ -112,7 +113,7 @@
LOGIT_ERROR("Can not parse DN line: " << lines[j]);
BLOCXX_THROW(ca_mgm::RuntimeException,
- Format("Can not parse DN line: %1", lines[j]).c_str());
+ str::form("Can not parse DN line: %1", lines[j]).c_str());
}
@@ -145,7 +146,7 @@
for(uint j = 0 ; j < lines.size(); ++j)
{
- StringArray vals = re.capture(lines[j]);
+ std::vectorstd::string vals = re.capture(lines[j]);
if(vals.size() != 3)
{
@@ -154,7 +155,7 @@
LOGIT_ERROR("Can not parse DN line: " << lines[j]);
BLOCXX_THROW(ca_mgm::RuntimeException,
// %1 is the wrong part of a DN which could not be parsed
- Format(__("Cannot parse DN line: %1."), lines[j]).c_str());
+ str::form(__("Cannot parse DN line: %s."), lines[j].c_str()).c_str());
}
tmpDN.push_back(RDNObject_Priv(vals[1], vals[2]));
@@ -196,7 +197,7 @@
BLOCXX_THROW(ca_mgm::SyntaxException,
__("Missing section 'distinguished_name' in the configuration file."));
}
- String dnSect = ca.getConfig()->getValue("req_ca", "distinguished_name");
+ std::string dnSect = ca.getConfig()->getValue("req_ca", "distinguished_name");
StringList dnKeys = ca.getConfig()->getKeylist(dnSect);
@@ -204,17 +205,17 @@
{
LOGIT_ERROR("Can not parse Section " << dnSect);
BLOCXX_THROW(ca_mgm::SyntaxException,
- Format(__("Cannot parse section %1."), dnSect).c_str());
+ str::form(__("Cannot parse section %s."), dnSect.c_str()).c_str());
}
StringList::const_iterator it = dnKeys.begin();
- std::vectorblocxx::String > newDNSect;
+ std::vectorstd::string > newDNSect;
- String lastFieldName;
- String defaultValue;
+ std::string lastFieldName;
+ std::string defaultValue;
for(; it != dnKeys.end(); ++it)
{
- if((*it).endsWith("_default", String::E_CASE_INSENSITIVE))
+ if(str::endsWithCI(*it, "_default"))
{
// delete the old default value
// if there is a new one we add it later
@@ -226,8 +227,8 @@
// we enter a new fieldName
// let's have a look if we need and have a default for lastFieldName
- if(!(lastFieldName.startsWith("commonName", String::E_CASE_INSENSITIVE) ||
- lastFieldName.startsWith("emailAddress", String::E_CASE_INSENSITIVE)))
+ if(!(str::startsWithCI(lastFieldName, "commonName") ||
+ str::startsWithCI(lastFieldName, "emailAddress")))
{
// do we have a default for lastFiledName?
std::list<RDNObject>::const_iterator rdnIT;
@@ -242,7 +243,7 @@
}
if(defaultValue != "")
{
- std::vectorblocxx::String line(2, "");
+ std::vectorstd::string line(2, "");
line[0] = lastFieldName + "_default";
line[1] = defaultValue;
newDNSect.push_back(line);
@@ -253,14 +254,14 @@
defaultValue = "";
}
- std::vectorblocxx::String line(2, "");
+ std::vectorstd::string line(2, "");
line[0] = *it;
line[1] = ca.getConfig()->getValue(dnSect, *it);
newDNSect.push_back(line);
ca.getConfig()->deleteValue(dnSect, *it);
}
- std::vectorblocxx::String >::const_iterator newIT;
+ std::vectorstd::string >::const_iterator newIT;
for(newIT = newDNSect.begin(); newIT != newDNSect.end(); ++newIT)
{
Modified: limal-branches/mc-devel/limal-ca-mgm/src/DNObject_Priv.hpp
URL: http://svn.opensuse.org/viewcvs/limal/limal-branches/mc-devel/limal-ca-mgm/src/DNObject_Priv.hpp?rev=2675&r1=2674&r2=2675&view=diff
==============================================================================
--- limal-branches/mc-devel/limal-ca-mgm/src/DNObject_Priv.hpp (original)
+++ limal-branches/mc-devel/limal-ca-mgm/src/DNObject_Priv.hpp Sat Jul 3 13:27:18 2010
@@ -35,8 +35,8 @@
class RDNObject_Priv : public RDNObject {
public:
RDNObject_Priv();
- RDNObject_Priv(const String& type, const String& value,
- const String& prompt = String(),
+ RDNObject_Priv(const std::string& type, const std::string& value,
+ const std::string& prompt = std::string(),
uint32_t min = 0,
uint32_t max = 0);
@@ -51,8 +51,8 @@
* @param min minimal string length of value; 0 == min not set
* @param max maximal string length of value; 0 == max not set
*/
- void setRDN(const String& type, const String& value,
- const String& prompt = String(),
+ void setRDN(const std::string& type, const std::string& value,
+ const std::string& prompt = std::string(),
uint32_t min = 0,
uint32_t max = 0);
Modified: limal-branches/mc-devel/limal-ca-mgm/src/Date.cpp
URL: http://svn.opensuse.org/viewcvs/limal/limal-branches/mc-devel/limal-ca-mgm/src/Date.cpp?rev=2675&r1=2674&r2=2675&view=diff
==============================================================================
--- limal-branches/mc-devel/limal-ca-mgm/src/Date.cpp (original)
+++ limal-branches/mc-devel/limal-ca-mgm/src/Date.cpp Sat Jul 3 13:27:18 2010
@@ -48,11 +48,12 @@
char * res = ::strptime( date_str.c_str(), format.c_str(), &tm );
if ( res != NULL )
+ {
if(utc)
_date = ::timegm( &tm );
else
_date = ::timelocal( &tm );
-
+ }
restoreLocale(thisLocale);
if (res == NULL)
Modified: limal-branches/mc-devel/limal-ca-mgm/src/ExtendedKeyUsageExt.cpp
URL: http://svn.opensuse.org/viewcvs/limal/limal-branches/mc-devel/limal-ca-mgm/src/ExtendedKeyUsageExt.cpp?rev=2675&r1=2674&r2=2675&view=diff
==============================================================================
--- limal-branches/mc-devel/limal-ca-mgm/src/ExtendedKeyUsageExt.cpp (original)
+++ limal-branches/mc-devel/limal-ca-mgm/src/ExtendedKeyUsageExt.cpp Sat Jul 3 13:27:18 2010
@@ -72,18 +72,18 @@
{
LOGIT_ERROR("wrong type" << type);
BLOCXX_THROW(ca_mgm::ValueException,
- Format(__("Wrong type: %1."), type).c_str());
+ str::form(__("Wrong type: %1."), type).c_str());
}
bool p = caConfig->exists(type2Section(type, true), "extendedKeyUsage");
if(p)
{
- String ct = caConfig->getValue(type2Section(type, true),
+ std::string ct = caConfig->getValue(type2Section(type, true),
"extendedKeyUsage");
- std::vectorblocxx::String sp = convStringArray(PerlRegEx("\\s*,\\s*").split(ct));
+ std::vectorstd::string sp = PerlRegEx("\\s*,\\s*").split(ct);
- std::vectorblocxx::String::const_iterator it = sp.begin();
- if(sp[0].equalsIgnoreCase("critical"))
+ std::vectorstd::string::const_iterator it = sp.begin();
+ if(0 == str::compareCI(sp[0], "critical"))
{
setCritical(true);
++it; // ignore critical for further checks
@@ -117,8 +117,8 @@
{
LOGIT_INFO("Unknown ExtendedKeyUsage option: " << (*it));
BLOCXX_THROW(ca_mgm::ValueException,
- Format(__("Invalid ExtendedKeyUsage option %1."),
- *it).c_str());
+ str::form(__("Invalid ExtendedKeyUsage option %s."),
+ (*it).c_str()).c_str());
}
}
@@ -166,8 +166,8 @@
{
LOGIT_INFO("Unknown ExtendedKeyUsage option: " << (*it));
BLOCXX_THROW(ca_mgm::ValueException,
- Format(__("Invalid ExtendedKeyUsage option %1."),
- *it).c_str());
+ str::form(__("Invalid ExtendedKeyUsage option %s."),
+ (*it).c_str()).c_str());
}
}
@@ -193,7 +193,7 @@
}
bool
-ExtendedKeyUsageExt::isEnabledFor(const String& extKeyUsage) const
+ExtendedKeyUsageExt::isEnabledFor(const std::string& extKeyUsage) const
{
// if ! isPresent() ... throw exceptions?
if(!isPresent() || m_impl->usage.empty()) return false;
@@ -201,7 +201,7 @@
StringList::const_iterator it = m_impl->usage.begin();
for(;it != m_impl->usage.end(); ++it)
{
- if(extKeyUsage.equalsIgnoreCase(*it))
+ if(0 == str::compareCI(extKeyUsage, *it))
{
return true;
}
@@ -224,12 +224,12 @@
{
LOGIT_ERROR("wrong type" << type);
BLOCXX_THROW(ca_mgm::ValueException,
- Format(__("Wrong type: %1."), type).c_str());
+ str::form(__("Wrong type: %1."), type).c_str());
}
if(isPresent())
{
- String extendedKeyUsageString;
+ std::string extendedKeyUsageString;
if(isCritical()) extendedKeyUsageString += "critical,";
@@ -270,16 +270,16 @@
return true;
}
-std::vectorblocxx::String
+std::vectorstd::string
ExtendedKeyUsageExt::verify() const
{
- std::vectorblocxx::String result;
+ std::vectorstd::string result;
if(!isPresent()) return result;
if(m_impl->usage.empty())
{
- result.push_back(String("invalid ExtendedKeyUsageExt."));
+ result.push_back(std::string("invalid ExtendedKeyUsageExt."));
}
StringList::const_iterator it = m_impl->usage.begin();
@@ -287,17 +287,17 @@
{
if(!checkValue(*it))
{
- result.push_back(Format("invalid additionalOID(%1)", *it).toString());
+ result.push_back(str::form("invalid additionalOID(%s)", (*it).c_str()));
}
}
LOGIT_DEBUG_STRINGARRAY("ExtendedKeyUsageExt::verify()", result);
return result;
}
-std::vectorblocxx::String
+std::vectorstd::string
ExtendedKeyUsageExt::dump() const
{
- std::vectorblocxx::String result;
+ std::vectorstd::string result;
result.push_back("ExtendedKeyUsageExt::dump()");
appendArray(result, ExtensionBase::dump());
@@ -313,7 +313,7 @@
}
bool
-ExtendedKeyUsageExt::checkValue(const String& value) const
+ExtendedKeyUsageExt::checkValue(const std::string& value) const
{
if(OBJ_sn2nid(value.c_str()) == NID_undef)
{
Modified: limal-branches/mc-devel/limal-ca-mgm/src/ExtensionBase.cpp
URL: http://svn.opensuse.org/viewcvs/limal/limal-branches/mc-devel/limal-ca-mgm/src/ExtensionBase.cpp?rev=2675&r1=2674&r2=2675&view=diff
==============================================================================
--- limal-branches/mc-devel/limal-ca-mgm/src/ExtensionBase.cpp (original)
+++ limal-branches/mc-devel/limal-ca-mgm/src/ExtensionBase.cpp Sat Jul 3 13:27:18 2010
@@ -116,16 +116,16 @@
return m_impl->isPresent();
}
-std::vectorblocxx::String
+std::vectorstd::string
ExtensionBase::dump() const
{
- std::vectorblocxx::String result;
+ std::vectorstd::string result;
result.push_back("ExtensionBase::dump()");
- result.push_back("is Present = " + Bool(isPresent()).toString());
+ result.push_back("is Present = " + str::toString(isPresent()));
if(!isPresent()) return result;
- result.push_back("is Critical = " + Bool(isCritical()).toString());
+ result.push_back("is Critical = " + str::toString(isCritical()));
return result;
}
Modified: limal-branches/mc-devel/limal-ca-mgm/src/INIParser/INIParser.cpp
URL: http://svn.opensuse.org/viewcvs/limal/limal-branches/mc-devel/limal-ca-mgm/src/INIParser/INIParser.cpp?rev=2675&r1=2674&r2=2675&view=diff
==============================================================================
--- limal-branches/mc-devel/limal-ca-mgm/src/INIParser/INIParser.cpp (original)
+++ limal-branches/mc-devel/limal-ca-mgm/src/INIParser/INIParser.cpp Sat Jul 3 13:27:18 2010
@@ -140,7 +140,7 @@
{
m_path.push_back(key);
- std::vectorblocxx::String path;
+ std::vectorstd::string path;
StringList valueList;
valueList.clear();
@@ -169,7 +169,7 @@
EntrySize Section::entrySize() const
{
StringList stringList;
- std::vectorblocxx::String path;
+ std::vectorstd::string path;
path.clear();
stringList.clear();
path.push_back("value");
@@ -185,7 +185,7 @@
EntrySize Section::sectionSize() const
{
StringList stringList;
- std::vectorblocxx::String path;
+ std::vectorstd::string path;
path.clear();
stringList.clear();
path.push_back("section");
@@ -217,7 +217,7 @@
{
IniType ret = NO;
StringList stringList;
- std::vectorblocxx::String path;
+ std::vectorstd::string path;
path.clear();
stringList.clear();
path.push_back("value");
@@ -256,11 +256,11 @@
}
// -------------------------------------------------------------------
-std::listblocxx::String Section::getEntryKeys() const
+std::liststd::string Section::getEntryKeys() const
{
StringList entryKeys;
StringList stringList;
- std::vectorblocxx::String path;
+ std::vectorstd::string path;
path.clear();
stringList.clear();
@@ -286,7 +286,7 @@
{
EntryMap entrymap;
StringList stringList;
- std::vectorblocxx::String path;
+ std::vectorstd::string path;
path.clear();
stringList.clear();
@@ -300,7 +300,7 @@
it != stringList.end(); it++)
{
//evaluate
- std::vectorblocxx::String valuePath;
+ std::vectorstd::string valuePath;
StringList valueList;
Value value("");
Comment comment("");
@@ -338,11 +338,11 @@
}
// -------------------------------------------------------------------
-EntryMap Section::selectEntries(const blocxx::String &pattern,
+EntryMap Section::selectEntries(const std::string &pattern,
bool icase) const
{
EntryMap entryMap = getEntries();
- blocxx::PosixRegEx reg(pattern, REG_EXTENDED | (icase ? REG_ICASE : 0));
+ PosixRegEx reg(pattern, REG_EXTENDED | (icase ? REG_ICASE : 0));
EntryMap ret;
for (EntryMap::iterator it = entryMap.begin(); it !=entryMap.end(); it++ )
@@ -399,7 +399,7 @@
return false;
}
- std::vectorblocxx::String path;
+ std::vectorstd::string path;
path.clear();
path.push_back("value");
appendArray (path, m_path);
@@ -411,7 +411,7 @@
// -------------------------------------------------------------------
bool Section::addValue(const Key &key, const Value &value)
{
- std::vectorblocxx::String valuePath;
+ std::vectorstd::string valuePath;
StringList valueList;
valueList.clear();
@@ -438,7 +438,7 @@
// adding value
ok = addValue (key, entry.getValue());
- std::vectorblocxx::String valuePath;
+ std::vectorstd::string valuePath;
StringList valueList;
valueList.clear();
@@ -490,11 +490,11 @@
}
// -------------------------------------------------------------------
-std::listblocxx::String Section::getSectionKeys() const
+std::liststd::string Section::getSectionKeys() const
{
StringList sectionList;
StringList stringList;
- std::vectorblocxx::String path;
+ std::vectorstd::string path;
path.clear();
stringList.clear();
@@ -520,7 +520,7 @@
{
SectionMap sectionMap;
StringList stringList;
- std::vectorblocxx::String path;
+ std::vectorstd::string path;
path.clear();
stringList.clear();
@@ -546,11 +546,11 @@
// -------------------------------------------------------------------
-SectionMap Section::selectSections(const blocxx::String &pattern,
+SectionMap Section::selectSections(const std::string &pattern,
bool icase) const
{
SectionMap sectionMap = getSections();
- blocxx::PosixRegEx reg(pattern, REG_EXTENDED | (icase ? REG_ICASE : 0));
+ PosixRegEx reg(pattern, REG_EXTENDED | (icase ? REG_ICASE : 0));
SectionMap ret;
for (SectionMap::iterator it = sectionMap.begin(); it !=sectionMap.end(); it++ )
@@ -595,7 +595,7 @@
return false;
}
- std::vectorblocxx::String path;
+ std::vectorstd::string path;
path.clear();
path.push_back("section");
appendArray (path, m_path);
@@ -608,7 +608,7 @@
// -------------------------------------------------------------------
bool Section::setComment( const Comment &comment)
{
- std::vectorblocxx::String valuePath;
+ std::vectorstd::string valuePath;
StringList valueList;
valueList.clear();
@@ -630,7 +630,7 @@
// -------------------------------------------------------------------
Comment Section::getComment()
{
- std::vectorblocxx::String valuePath;
+ std::vectorstd::string valuePath;
StringList valueList;
Comment comment;
@@ -691,30 +691,30 @@
// -------------------------------------------------------------------
-void INIParser::initFiles (const String &filename)
+void INIParser::initFiles (const std::string &filename)
{
parser->initFiles (filename.c_str());
}
// -------------------------------------------------------------------
-void INIParser::initFiles (const std::vectorblocxx::String &fileList )
+void INIParser::initFiles (const std::vectorstd::string &fileList )
{
parser->initFiles(fileList);
}
// -------------------------------------------------------------------
bool INIParser::initMachine (const std::vector<Options> &options,
- const std::vectorblocxx::String &commentsDescr,
+ const std::vectorstd::string &commentsDescr,
const std::vector<SectionDescr> §ionDescr,
const std::vector<EntryDescr> &entryDescr,
const std::vector<IoPatternDescr> &rewrites,
- const blocxx::String &subident)
+ const std::string &subident)
{
// Resetting flags; set to "is init"
parser->reset();
// options
- std::vectorblocxx::String opt;
+ std::vectorstd::string opt;
opt.clear();
for (unsigned int i = 0;iblocxx::String commentsDescr;
+ std::vectorstd::string commentsDescr;
std::vector<SectionDescr> sectionDescr;
std::vector<EntryDescr> entryDescr;
std::vector<IoPatternDescr> rewrites;
Modified: limal-branches/mc-devel/limal-ca-mgm/src/INIParser/INIParser.hpp
URL: http://svn.opensuse.org/viewcvs/limal/limal-branches/mc-devel/limal-ca-mgm/src/INIParser/INIParser.hpp?rev=2675&r1=2674&r2=2675&view=diff
==============================================================================
--- limal-branches/mc-devel/limal-ca-mgm/src/INIParser/INIParser.hpp (original)
+++ limal-branches/mc-devel/limal-ca-mgm/src/INIParser/INIParser.hpp Sat Jul 3 13:27:18 2010
@@ -54,19 +54,19 @@
/**
* @brief INI keyword string
*/
-typedef blocxx::String Key;
+typedef std::string Key;
/**
* @brief INI value string
*/
-typedef blocxx::String Value;
+typedef std::string Value;
/**
* @brief INI comment string array
*/
-typedef blocxx::String Comment;
+typedef std::string Comment;
/**
@@ -183,9 +183,9 @@
/**
* Get all entry keys of a section in the order like they
* have been written to file.
- * @return std::listblocxx::String
+ * @return std::liststd::string
*/
- std::listblocxx::String getEntryKeys() const;
+ std::liststd::string getEntryKeys() const;
/**
@@ -199,7 +199,7 @@
* @param pattern string, ignore cases
* @return EntryMap ( key, entry )
*/
- EntryMap selectEntries(const blocxx::String &pattern,
+ EntryMap selectEntries(const std::string &pattern,
bool icase = false) const;
/**
@@ -277,9 +277,9 @@
/**
* Get all section keys of a section in the order like they
* have been written to file.
- * @return std::listblocxx::String
+ * @return std::liststd::string
*/
- std::listblocxx::String getSectionKeys() const;
+ std::liststd::string getSectionKeys() const;
/**
@@ -293,7 +293,7 @@
* @param pattern string, ignore cases
* @return SectionMap (key, section)
*/
- SectionMap selectSections(const blocxx::String &pattern,
+ SectionMap selectSections(const std::string &pattern,
bool icase = false ) const;
@@ -321,7 +321,7 @@
private:
- std::vectorblocxx::String m_path;
+ std::vectorstd::string m_path;
blocxx::IntrusiveReference<IniParser> m_parser;
};
@@ -404,7 +404,7 @@
* using namespace ca_mgm::INI;
*
* std::vector<Options> options; // Options like NO_NESTED_SECTIONS, LINE_CAN_CONTINUE, ...
- * std::vectorblocxx::String commentsDescr; // Regular expression of the comments description
+ * std::vectorstd::string commentsDescr; // Regular expression of the comments description
* std::vector<SectionDescr> sectionDescr; // Regular expression of a section description
* std::vector<EntryDescr> entryDescr; // Regular expressions for entries (keys/values).
* std::vector<IoPatternDescr> rewrites; // rules for writing key/value
@@ -480,13 +480,13 @@
* Sets parser to single file mode and sets the file name to read.
* @param fn file name of ini file
*/
- void initFiles (const blocxx::String &filename);
+ void initFiles (const std::string &filename);
/**
* Sets parser to multiple file mode and sets the glob-expressions.
* @param fileList list of glob-expressions
*/
- void initFiles (const std::vectorblocxx::String &fileList );
+ void initFiles (const std::vectorstd::string &fileList );
/**
* Sets flags and regular expressions.
@@ -536,11 +536,11 @@
* @return true if successful
*/
virtual bool initMachine (const std::vector<Options> &options,
- const std::vectorblocxx::String &commentsDescr,
+ const std::vectorstd::string &commentsDescr,
const std::vector<SectionDescr> §ionDescr,
const std::vector<EntryDescr> &entryDescr,
const std::vector<IoPatternDescr> &rewrites,
- const blocxx::String &subident = "");
+ const std::string &subident = "");
/**
* Check, if the parser has been already initialized
Modified: limal-branches/mc-devel/limal-ca-mgm/src/INIParser/INIParserDescr.hpp
URL: http://svn.opensuse.org/viewcvs/limal/limal-branches/mc-devel/limal-ca-mgm/src/INIParser/INIParserDescr.hpp?rev=2675&r1=2674&r2=2675&view=diff
==============================================================================
--- limal-branches/mc-devel/limal-ca-mgm/src/INIParser/INIParserDescr.hpp (original)
+++ limal-branches/mc-devel/limal-ca-mgm/src/INIParser/INIParserDescr.hpp Sat Jul 3 13:27:18 2010
@@ -50,12 +50,12 @@
* Reading description;
* An extended regular expression contatining two subexpressions ("...(...)...(...)..."), the name and the value of the entry
*/
- blocxx::String regExpr;
+ std::string regExpr;
/**
* Writing description;
* A pair item is a printf format string containing two %s placeholders for the name and the value.
*/
- blocxx::String out;
+ std::string out;
};
/**
@@ -115,13 +115,13 @@
IoPatternDescr line;
/**
- * String which marks the beginning of a value.
+ * std::string which marks the beginning of a value.
*/
- blocxx::String multiBegin;
+ std::string multiBegin;
/**
- * String which marks the ending of a value.
+ * std::string which marks the ending of a value.
*/
- blocxx::String multiEnd;
+ std::string multiEnd;
/**
* Flag if the multiline has been specified
*/
Modified: limal-branches/mc-devel/limal-ca-mgm/src/INIParser/IniFile.cpp
URL: http://svn.opensuse.org/viewcvs/limal/limal-branches/mc-devel/limal-ca-mgm/src/INIParser/IniFile.cpp?rev=2675&r1=2674&r2=2675&view=diff
==============================================================================
--- limal-branches/mc-devel/limal-ca-mgm/src/INIParser/IniFile.cpp (original)
+++ limal-branches/mc-devel/limal-ca-mgm/src/INIParser/IniFile.cpp Sat Jul 3 13:27:18 2010
@@ -28,10 +28,10 @@
using std::pair;
using namespace blocxx;
-String pathToString(const std::vectorblocxx::String&p)
+std::string pathToString(const std::vectorstd::string&p)
{
- if (p.empty()) return String(".");
- String v;
+ if (p.empty()) return std::string(".");
+ std::string v;
for (unsigned c=0; cchangeCase (key);
+ std::string k = ip->changeCase (key);
IniEntry e;
IniEntryIdxIterator exi;
if (!ip->repeatNames () && (exi = ivalues.find (k)) != ivalues.end ())
@@ -71,9 +71,9 @@
ivalues.insert (IniEntryIndex::value_type (k, --container.end ()));
}
-void IniSection::initSection (const String&name,const String&comment,int rb, int wb)
+void IniSection::initSection (const std::string&name,const std::string&comment,int rb, int wb)
{
- String k = ip->changeCase (name);
+ std::string k = ip->changeCase (name);
IniSection s (ip);
IniSectionIdxIterator sxi;
@@ -109,9 +109,9 @@
isections.insert (IniSectionIndex::value_type (k, --container.end ()));
}
-IniSection& IniSection::findSection(const std::vectorblocxx::String&path, int from)
+IniSection& IniSection::findSection(const std::vectorstd::string&path, int from)
{
- String k = ip->changeCase (path[from]);
+ std::string k = ip->changeCase (path[from]);
IniSectionIdxIterator v = isections.find(k);
if (v == isections.end ())
{
@@ -122,7 +122,7 @@
return from+1 >= (int)path.size() ? s : s.findSection (path, from+1);
}
-int IniSection::findEndFromUp (const std::vectorblocxx::String&path, int wanted, int found, int from)
+int IniSection::findEndFromUp (const std::vectorstd::string&path, int wanted, int found, int from)
{
@@ -133,7 +133,7 @@
if (from < (int)path.size())
{
- String k = ip->changeCase (path[from]);
+ std::string k = ip->changeCase (path[from]);
// find the _last_ section with key k
pair r =
isections.equal_range (k);
@@ -213,20 +213,20 @@
if (ci->t () == VALUE)
{
- String k = ip->changeCase (ci->e ().getName ());
+ std::string k = ip->changeCase (ci->e ().getName ());
ivalues.insert (IniEntryIndex::value_type (k, ci));
}
else
{
- String k = ip->changeCase (ci->s ().getName ());
+ std::string k = ip->changeCase (ci->s ().getName ());
isections.insert (IniSectionIndex::value_type (k, ci));
}
}
}
-int IniSection::getMyValue (const std::vectorblocxx::String &p, StringList &out, int what, int depth)
+int IniSection::getMyValue (const std::vectorstd::string &p, StringList &out, int what, int depth)
{
- String k = ip->changeCase (p[depth]);
+ std::string k = ip->changeCase (p[depth]);
// Find all values and return them according to repeat_names
StringList results;
bool found = false;
@@ -240,14 +240,14 @@
out.clear();
switch (what)
{
- case 0: out.push_back (String (e.getValue ()));
- results.push_back (String (e.getValue ()));
+ case 0: out.push_back (std::string (e.getValue ()));
+ results.push_back (std::string (e.getValue ()));
break;
- case 1: out.push_back (String (e.getComment()));
- results.push_back (String (e.getComment()));
+ case 1: out.push_back (std::string (e.getComment()));
+ results.push_back (std::string (e.getComment()));
break;
- default: out.push_back (String (e.getReadBy ()));
- results.push_back (String (e.getReadBy ()));
+ default: out.push_back (str::numstring (e.getReadBy ()));
+ results.push_back (str::numstring (e.getReadBy ()));
break;
}
}
@@ -268,9 +268,9 @@
return -1;
}
-int IniSection::getValue (const std::vectorblocxx::String&p, StringList&out,int what, int depth)
+int IniSection::getValue (const std::vectorstd::string&p, StringList&out,int what, int depth)
{
- String k = ip->changeCase (p[depth]);
+ std::string k = ip->changeCase (p[depth]);
if ( depth + 1 < int(p.size()))
{
// it must be a section
@@ -292,9 +292,9 @@
}
// Read calls us with the path length >= 2
-int IniSection::getSectionProp (const std::vectorblocxx::String&p, StringList&out, int what, int depth)
+int IniSection::getSectionProp (const std::vectorstd::string&p, StringList&out, int what, int depth)
{
- String k = ip->changeCase (p[depth]);
+ std::string k = ip->changeCase (p[depth]);
// Find the matching sections.
// If we need to recurse, choose one
// Otherwise gather properties of all of the leaf sections
@@ -331,13 +331,13 @@
}
else if (what == 1)
{
- out.push_back (String (s.rewrite_by));
- results.push_back (String (s.rewrite_by));
+ out.push_back (str::numstring (s.rewrite_by));
+ results.push_back (str::numstring (s.rewrite_by));
}
else
{
- out.push_back (String (s.read_by));
- results.push_back (String (s.read_by));
+ out.push_back (str::numstring (s.read_by));
+ results.push_back (str::numstring (s.read_by));
}
}
@@ -359,13 +359,13 @@
return -1;
}
-int IniSection::getAll (const std::vectorblocxx::String&p, SectionAll&out, int depth)
+int IniSection::getAll (const std::vectorstd::string&p, SectionAll&out, int depth)
{
if (depth < int(p.size ()))
{
// recurse to find the starting section
// Get any section of that name
- String k = ip->changeCase (p[depth]);
+ std::string k = ip->changeCase (p[depth]);
IniSectionIdxIterator sxi = isections.find (k);
if (sxi != isections.end())
{
@@ -388,7 +388,7 @@
SectionAll m = IniBase::getAllDoIt ();
m.kind = "section";
- m.file = String(rewrite_by);
+ m.file = str::numstring(rewrite_by);
m.value = "";
IniIterator
@@ -415,7 +415,7 @@
return m;
}
-int IniSection::Delete (const std::vectorblocxx::String&p)
+int IniSection::Delete (const std::vectorstd::string&p)
{
if (ip->isFlat ())
return delValueFlat (p);
@@ -424,7 +424,7 @@
LIMAL_SLOG_ERROR (logger, "I do not know what to delete at " << pathToString(p).c_str());
return -1;
}
- String s (p[0]);
+ std::string s (p[0]);
if (s == "v" || s == "value")
return delValue (p, 1);
if (s == "s" || s == "section")
@@ -432,7 +432,7 @@
return -1;
}
-int IniSection::Write (const std::vectorblocxx::String&p, const StringList&v, bool rewrite)
+int IniSection::Write (const std::vectorstd::string&p, const StringList&v, bool rewrite)
{
if (ip->isFlat ())
return setValueFlat (p, v);
@@ -442,7 +442,7 @@
LIMAL_SLOG_ERROR (logger, "I do not know what to write to " << pathToString(p).c_str());
return -1;
}
- String s (p[0]);
+ std::string s (p[0]);
if (s == "v" || s == "value")
return setValue (p, v, 0, 1);
if (s == "vc" || s == "value_comment" || s == "valuecomment")
@@ -456,9 +456,9 @@
return -1;
}
-int IniSection::setSectionProp (const std::vectorblocxx::String&p,const StringList&in, int what, int depth)
+int IniSection::setSectionProp (const std::vectorstd::string&p,const StringList&in, int what, int depth)
{
- String k = ip->changeCase (p[depth]);
+ std::string k = ip->changeCase (p[depth]);
// Find the matching sections.
// If we need to recurse, choose one, creating if necessary
// Otherwise set properties of all of the leaf sections,
@@ -514,7 +514,7 @@
}
else
{
- String prop = String(*pi);
+ std::string prop = std::string(*pi);
IniIterator si;
if (xi == xe)
{
@@ -539,9 +539,9 @@
if (what == 0)
s.setComment (prop);
else if (what == 1)
- s.setRewriteBy (prop.toInt());
+ s.setRewriteBy (str::strtonum<int>(prop));
else
- s.setReadBy (prop.toInt());
+ s.setReadBy (str::strtonum<int>(prop));
if (xi != xe)
{
@@ -563,9 +563,9 @@
isections.erase (sxi);
}
-int IniSection::delSection(const std::vectorblocxx::String&p, int depth)
+int IniSection::delSection(const std::vectorstd::string&p, int depth)
{
- String k = ip->changeCase (p[depth]);
+ std::string k = ip->changeCase (p[depth]);
// Find the matching sections.
// If we need to recurse, choose one
@@ -603,14 +603,14 @@
return 0;
}
-int IniSection::WriteAll (const std::vectorblocxx::String&p, const SectionAll& in, int depth)
+int IniSection::WriteAll (const std::vectorstd::string&p, const SectionAll& in, int depth)
{
LIMAL_SLOG_INFO (logger, "This function has not been tested cause it is not needed at the moment.");
if (depth < int(p.size ()))
{
// recurse to find the starting section
// Get any section of that name
- String k = ip->changeCase (p[depth]);
+ std::string k = ip->changeCase (p[depth]);
IniSectionIdxIterator sxi = isections.find (k);
if (sxi != isections.end())
{
@@ -635,14 +635,14 @@
return ret;
}
- String kind = in.kind;
+ std::string kind = in.kind;
if (kind != "section")
{
LIMAL_SLOG_ERROR (logger, "Kind should be 'section'");
return -1;
}
- rewrite_by = in.file.toInt();
+ rewrite_by = str::strtonum<int>(in.file);
SectionList l = in.sectionList;
@@ -686,10 +686,10 @@
return ret;
}
-int IniSection::setMyValue (const std::vectorblocxx::String &p, const StringList&in, int what, int depth)
+int IniSection::setMyValue (const std::vectorstd::string &p, const StringList&in, int what, int depth)
{
// assert (depth == p.size ()); //not, it can have a .comment suffix
- String k = ip->changeCase (p[depth]);
+ std::string k = ip->changeCase (p[depth]);
pair r =
ivalues.equal_range (k);
IniEntryIdxIterator xi = r.first, xe = r.second;
@@ -713,7 +713,7 @@
}
else
{
- String prop = String(*pi);
+ std::string prop = std::string(*pi);
IniIterator ei;
if (xi == xe)
{
@@ -749,7 +749,7 @@
{
case 0: e.setValue (prop); break;
case 1: e.setComment (prop); break;
- default: e.setReadBy (prop.toInt());break;
+ default: e.setReadBy (str::strtonum<int>(prop));break;
}
if (xi != xe)
@@ -764,9 +764,9 @@
return 0;
}
-int IniSection::setValue (const std::vectorblocxx::String&p,const StringList&in,int what, int depth)
+int IniSection::setValue (const std::vectorstd::string&p,const StringList&in,int what, int depth)
{
- String k = ip->changeCase (p[depth]);
+ std::string k = ip->changeCase (p[depth]);
// Find the matching sections.
// If we need to recurse, choose one, creating if necessary
// Otherwise set all the matching values
@@ -813,7 +813,7 @@
ivalues.erase (exi);
}
-void IniSection::delMyValue (const String &k)
+void IniSection::delMyValue (const std::string &k)
{
pair r =
ivalues.equal_range (k);
@@ -829,9 +829,9 @@
}
}
-int IniSection::delValue (const std::vectorblocxx::String&p, int depth)
+int IniSection::delValue (const std::vectorstd::string&p, int depth)
{
- String k = ip->changeCase (p[depth]);
+ std::string k = ip->changeCase (p[depth]);
// Find the matching sections.
// If we need to recurse, choose one
// Otherwise kill all values of the name
@@ -868,7 +868,7 @@
{
if (i->t () == what)
{
- String n = (what == SECTION) ?
+ std::string n = (what == SECTION) ?
i->s ().getName () :
i->e ().getName ();
l.push_back (n);
@@ -877,7 +877,7 @@
return 0;
}
-int IniSection::dirValueFlat (const std::vectorblocxx::String&p, StringList&l)
+int IniSection::dirValueFlat (const std::vectorstd::string&p, StringList&l)
{
// This function used to discard p and always return Dir (.)
// #21574
@@ -892,37 +892,37 @@
return myDir (l, VALUE);
}
-int IniSection::getValueFlat (const std::vectorblocxx::String&p, StringList&out)
+int IniSection::getValueFlat (const std::vectorstd::string&p, StringList&out)
{
if (!p.size ())
return -1;
- String k = ip->changeCase (p[0]);
+ std::string k = ip->changeCase (p[0]);
bool want_comment = p.size()>1 && p[1]=="comment";
return getMyValue (p, out, want_comment, 0);
}
-int IniSection::delValueFlat (const std::vectorblocxx::String&p)
+int IniSection::delValueFlat (const std::vectorstd::string&p)
{
if (!p.size ())
return -1;
- String k = ip->changeCase (p[0]);
+ std::string k = ip->changeCase (p[0]);
delMyValue (k);
return 0;
}
-int IniSection::setValueFlat (const std::vectorblocxx::String&p, const StringList &in)
+int IniSection::setValueFlat (const std::vectorstd::string&p, const StringList &in)
{
if (!p.size ())
return -1;
- String k = ip->changeCase (p[0]);
+ std::string k = ip->changeCase (p[0]);
bool want_comment = p.size()>1 && p[1]=="comment";
return setMyValue (p, in, want_comment, 0);
}
-int IniSection::Read (const std::vectorblocxx::String&p, StringList&out, bool rewrite)
+int IniSection::Read (const std::vectorstd::string&p, StringList&out, bool rewrite)
{
if (ip->isFlat ())
return getValueFlat (p, out);
@@ -932,7 +932,7 @@
LIMAL_SLOG_ERROR (logger, "I do not know what to read from " << pathToString(p).c_str());
return -1;
}
- String s (p[0]);
+ std::string s (p[0]);
if (s == "v" || s == "value")
return getValue (p, out, 0, 1);
else if (s == "vc" || s == "value_comment" || s == "valuecomment")
@@ -948,7 +948,7 @@
return -1;
}
-int IniSection::ReadAll (const std::vectorblocxx::String&p, SectionAll&out)
+int IniSection::ReadAll (const std::vectorstd::string&p, SectionAll&out)
{
LIMAL_SLOG_INFO (logger, "This function has not been tested cause it is not needed at the moment.");
if (p.size() >= 1 && p[0] == "all")
@@ -961,7 +961,7 @@
}
}
-int IniSection::Dir (const std::vectorblocxx::String&p, StringList&l)
+int IniSection::Dir (const std::vectorstd::string&p, StringList&l)
{
if (ip->isFlat ())
return dirValueFlat (p, l);
@@ -971,7 +971,7 @@
return -1;
}
- String s (p[0]);
+ std::string s (p[0]);
if (s == "v" || s == "value")
return dirHelper (p, l, 0, 1);
else if (s == "s" || s == "section")
@@ -980,7 +980,7 @@
LIMAL_SLOG_ERROR (logger, "I do not know what to dir from "<< pathToString(p).c_str());
return -1;
}
-int IniSection::dirHelper (const std::vectorblocxx::String&p, StringList&out,int get_sect,int depth)
+int IniSection::dirHelper (const std::vectorstd::string&p, StringList&out,int get_sect,int depth)
{
if (depth >= int(p.size()))
{
@@ -988,7 +988,7 @@
}
// recurse
- String k = ip->changeCase (p[depth]);
+ std::string k = ip->changeCase (p[depth]);
pair r =
isections.equal_range (k);
Modified: limal-branches/mc-devel/limal-ca-mgm/src/INIParser/IniFile.h
URL: http://svn.opensuse.org/viewcvs/limal/limal-branches/mc-devel/limal-ca-mgm/src/INIParser/IniFile.h?rev=2675&r1=2674&r2=2675&view=diff
==============================================================================
--- limal-branches/mc-devel/limal-ca-mgm/src/INIParser/IniFile.h (original)
+++ limal-branches/mc-devel/limal-ca-mgm/src/INIParser/IniFile.h Sat Jul 3 13:27:18 2010
@@ -15,7 +15,7 @@
#define IniFile_h
#include
-#include
+#include
#include
#include "INIParser/INIParserDescr.hpp"
#include <list>
@@ -38,17 +38,17 @@
struct SectionAll
{
- blocxx::String kind; //section,value
- blocxx::String name;
- blocxx::String type; // section_type
- blocxx::String file; // "rewrite", section_file
- blocxx::String comment;
- blocxx::String value; // if kind == value
+ std::string kind; //section,value
+ std::string name;
+ std::string type; // section_type
+ std::string file; // "rewrite", section_file
+ std::string comment;
+ std::string value; // if kind == value
SectionList sectionList;
};
-typedef std::listblocxx::String StringList;
-typedef std::map StringMap;
+typedef std::liststd::string StringList;
+typedef std::map StringMap;
/**
* Base class of IniEntry and IniSection.
@@ -60,9 +60,9 @@
{
protected:
/** name */
- blocxx::String name;
+ std::string name;
/** comment */
- blocxx::String comment;
+ std::string comment;
/** index to params/sections in IniParser using which this item was read */
int read_by;
/** changed? */
@@ -72,7 +72,7 @@
IniBase (int rb)
: name (), comment (), read_by (rb), dirty (false) {}
/** Used by another IniSection ctor */
- IniBase (const blocxx::String &n)
+ IniBase (const std::string &n)
: name (n), comment (), read_by (0), dirty (true) {}
public:
virtual ~IniBase () {}
@@ -85,24 +85,24 @@
virtual void clean() { dirty = false; }
/** changes and sets dirty flag */
- void setName(const blocxx::String&c) { dirty = true; name = c; }
+ void setName(const std::string&c) { dirty = true; name = c; }
/** changes and sets dirty flag */
- void setComment(const blocxx::String&c) { dirty = true; comment = c; }
+ void setComment(const std::string&c) { dirty = true; comment = c; }
/** changes and sets dirty flag */
void setReadBy(int r) { dirty = true; read_by = r; }
/** sets dirty flag */
void setDirty() { dirty = true; }
/** changes value only if not dirty */
- void initName(const blocxx::String&c) { if (!dirty) name = c; }
+ void initName(const std::string&c) { if (!dirty) name = c; }
/** changes value only if not dirty */
- void initComment(const blocxx::String&c) { if (!dirty) comment = c; }
+ void initComment(const std::string&c) { if (!dirty) comment = c; }
/** changes value only if not dirty */
void initReadBy(const int r) { if (!dirty) read_by = r; }
/** changes values only if not dirty */
- void init(const blocxx::String &n,
- const blocxx::String&c, int rb)
+ void init(const std::string &n,
+ const std::string&c, int rb)
{
if (!dirty)
{
@@ -120,7 +120,7 @@
SectionAll m;
m.name = name;
- m.type = blocxx::String (read_by);
+ m.type = str::numstring (read_by);
m.comment = comment;
return m;
}
@@ -131,7 +131,7 @@
bool ok = true;
name = in.name;
comment = in.comment;
- read_by = in.type.toInt();
+ read_by = str::strtonum<int>(in.type);
return ok? 0: -1;
}
};
@@ -143,7 +143,7 @@
{
private:
/** value */
- blocxx::String val;
+ std::string val;
public:
IniEntry ()
: IniBase (0), val () {}
@@ -152,18 +152,18 @@
const char* getValue() const { return val.c_str(); }
- void setValue(const blocxx::String&c) { dirty = true; val = c; }
+ void setValue(const std::string&c) { dirty = true; val = c; }
/** changes value only if not dirty */
- void initValue(const blocxx::String&c) { if (!dirty) val = c; }
+ void initValue(const std::string&c) { if (!dirty) val = c; }
/** changes value only if not dirty */
void initReadBy(const int r) { if (!dirty) read_by = r; }
/** changes values only if not dirty */
- void init(const blocxx::String &n,
- const blocxx::String &c,
+ void init(const std::string &n,
+ const std::string &c,
int rb,
- const blocxx::String &v)
+ const std::string &v)
{
if (!dirty)
{
@@ -183,7 +183,7 @@
int ret = IniBase::setAllDoIt (in);
if (ret == 0)
{
- blocxx::String kind = in.kind;
+ std::string kind = in.kind;
if (kind != "value")
{
return -1;
@@ -204,8 +204,8 @@
typedef IniContainer::iterator IniIterator;
/** indices */
-typedef std::multimap IniEntryIndex;
-typedef std::multimap IniSectionIndex;
+typedef std::multimap IniEntryIndex;
+typedef std::multimap IniSectionIndex;
/**
Watch it, "find" finds an iterator pointing at an iterator (which is
in a pair with the key, uninteresting).
@@ -236,7 +236,7 @@
* if this is global section, there may be comment at the end
* this is quite special case, it is impossible to change it
*/
- blocxx::String end_comment;
+ std::string end_comment;
/** index to IniParser::rewrites for filename - section name mapping
* It appears that read_by was used for both purposes,
@@ -276,7 +276,7 @@
* @param depth path index
* @return 0 in case of success
*/
- int getMyValue (const std::vectorblocxx::String &p,
+ int getMyValue (const std::vectorstd::string &p,
StringList &out, int what, int depth);
/**
* Get a value on a path
@@ -288,7 +288,7 @@
* path[depth] in current "scope"
* @return 0 in case of success
*/
- int getValue (const std::vectorblocxx::String&p,
+ int getValue (const std::vectorstd::string&p,
StringList&out,int what, int depth = 0);
/**
* Get section property -- comment or read-by
@@ -300,7 +300,7 @@
* path[depth] in current "scope"
* @return 0 in case of success
*/
- int getSectionProp (const std::vectorblocxx::String&p,
+ int getSectionProp (const std::vectorstd::string&p,
StringList&out,int what, int depth = 0);
/**
* Get a complete subtree
@@ -311,7 +311,7 @@
* path[depth] in current "scope"
* @return 0 in case of success
*/
- int getAll (const std::vectorblocxx::String&p,
+ int getAll (const std::vectorstd::string&p,
SectionAll&out, int depth);
/**
* Gets data for this section and all its values and subsections
@@ -335,7 +335,7 @@
* @param depth see getSectionProp
* @return 0 in case of success
*/
- int dirHelper (const std::vectorblocxx::String&p,
+ int dirHelper (const std::vectorstd::string&p,
StringList&out,int sections,int depth = 0);
/**
* Set a value (or list of them if repeat_names) in this section
@@ -347,7 +347,7 @@
* @param depth path index
* @return 0
*/
- int setMyValue (const std::vectorblocxx::String &p,
+ int setMyValue (const std::vectorstd::string &p,
const StringList&in, int what, int depth);
/**
* Set value on path. Creates recursively all non-existing subsections.
@@ -357,7 +357,7 @@
* @param depth see getSectionProp
* @return 0
*/
- int setValue (const std::vectorblocxx::String&p,
+ int setValue (const std::vectorstd::string&p,
const StringList&in,int what, int depth = 0);
/**
* Set section comment or read-by. Creates recursively all non-existing subsections.
@@ -367,7 +367,7 @@
* @param depth see getSectionProp
* @return 0
*/
- int setSectionProp (const std::vectorblocxx::String&p,
+ int setSectionProp (const std::vectorstd::string&p,
const StringList&in, int what, int depth);
/**
@@ -382,7 +382,7 @@
* @param depth see getSectionProp
* @return 0 in case of success
*/
- int delValue (const std::vectorblocxx::String&p,
+ int delValue (const std::vectorstd::string&p,
int depth);
/**
* Delete section on path. Deletes also all its subsections.
@@ -390,14 +390,14 @@
* @param depth see getSectionProp
* @return 0 in case of success
*/
- int delSection (const std::vectorblocxx::String&p,
+ int delSection (const std::vectorstd::string&p,
int depth);
/**
* deletes all values of this name we own
* @param k normalized key
*/
- void delMyValue (const blocxx::String &k);
+ void delMyValue (const std::string &k);
/**
* deletes a section we own
*/
@@ -413,7 +413,7 @@
* @param out output
* @return 0 in case of success
*/
- int getValueFlat (const std::vectorblocxx::String&p,
+ int getValueFlat (const std::vectorstd::string&p,
StringList&out);
/**
* Set value in flat mode.
@@ -421,16 +421,16 @@
* @param out input
* @return 0 in case of success
*/
- int setValueFlat (const std::vectorblocxx::String&p,
+ int setValueFlat (const std::vectorstd::string&p,
const StringList& in);
/**
* Delete value in flat mode
*/
- int delValueFlat (const std::vectorblocxx::String&p);
+ int delValueFlat (const std::vectorstd::string&p);
/**
* Get list of values in flat mode.
*/
- int dirValueFlat (const std::vectorblocxx::String&p, StringList&l);
+ int dirValueFlat (const std::vectorstd::string&p, StringList&l);
// IniSection ();
public:
/** explicit uninitialized constructor */
@@ -478,7 +478,7 @@
* @param ip parser to take options from
* @param n name of section
*/
- IniSection (const blocxx::IntrusiveReference<IniParser> &p, blocxx::String n)
+ IniSection (const blocxx::IntrusiveReference<IniParser> &p, std::string n)
: IniBase (n),
ip (p),
end_comment (), rewrite_by(0),
@@ -492,9 +492,9 @@
* @param comment comment
* @param rb read-by
*/
- void initValue (const blocxx::String&key,
- const blocxx::String&val,
- const blocxx::String&comment,int rb);
+ void initValue (const std::string&key,
+ const std::string&val,
+ const std::string&comment,int rb);
/**
* If section already exist, it is updated only in case, that it isn't
* dirty.
@@ -503,8 +503,8 @@
* @param rb read-by
* @param wb rewrite-by. if -2 (default), it is not changed
*/
- void initSection (const blocxx::String&name,
- const blocxx::String&comment,int rb, int wb=-2);
+ void initSection (const std::string&name,
+ const std::string&comment,int rb, int wb=-2);
/**
* This function has very special purpose, it ensures that top-section
* delimiter is not written when saving multiple files.
@@ -541,7 +541,7 @@
* @param from recursion depth
* @return Found ini section iterator
*/
- IniSection& findSection(const std::vectorblocxx::String&path, int from = 0);
+ IniSection& findSection(const std::vectorstd::string&path, int from = 0);
/**
* If currently parsed end-section-tag hasn't matched currently
* processed section by name, we need to find the best possible match
@@ -555,7 +555,7 @@
* @param from let unset, current path index
* @return index to path
*/
- int findEndFromUp(const std::vectorblocxx::String&path,
+ int findEndFromUp(const std::vectorstd::string&path,
int wanted, int found = -1, int from = 0);
/**
@@ -567,20 +567,20 @@
* Generic interface to SCR::Read
* @param rewrite a #19066 hack - if rewriting is active, .st accesses rewrite_by
*/
- int Read (const std::vectorblocxx::String&p, StringList&out, bool rewrite);
+ int Read (const std::vectorstd::string&p, StringList&out, bool rewrite);
/**
* Get all properties and values of a section.
*/
- int ReadAll (const std::vectorblocxx::String&p, SectionAll&out);
+ int ReadAll (const std::vectorstd::string&p, SectionAll&out);
/**
* Generic interface to SCR::Dir
*/
- int Dir (const std::vectorblocxx::String&p, StringList&out);
+ int Dir (const std::vectorstd::string&p, StringList&out);
/**
* Generic interface to SCR::Write
* @param rewrite a #19066 hack - if rewriting is active, .st accesses rewrite_by
*/
- int Write (const std::vectorblocxx::String&p, const StringList&v, bool rewrite);
+ int Write (const std::vectorstd::string&p, const StringList&v, bool rewrite);
/**
* Set all properties and values for a section.
* No recursive creation of the specified path.
@@ -589,14 +589,14 @@
* @param depth see getSectionProp
* @return 0 in case of success
*/
- int WriteAll (const std::vectorblocxx::String&p,
+ int WriteAll (const std::vectorstd::string&p,
const SectionAll& in, int depth);
/**
* Generic delete for values, sections.
* @param p path to delete
* @return 0: success
*/
- int Delete (const std::vectorblocxx::String&p);
+ int Delete (const std::vectorstd::string&p);
// used by IniParser::write
IniIterator getContainerBegin ();
Modified: limal-branches/mc-devel/limal-ca-mgm/src/INIParser/IniParser.cpp
URL: http://svn.opensuse.org/viewcvs/limal/limal-branches/mc-devel/limal-ca-mgm/src/INIParser/IniParser.cpp?rev=2675&r1=2674&r2=2675&view=diff
==============================================================================
--- limal-branches/mc-devel/limal-ca-mgm/src/INIParser/IniParser.cpp (original)
+++ limal-branches/mc-devel/limal-ca-mgm/src/INIParser/IniParser.cpp Sat Jul 3 13:27:18 2010
@@ -29,7 +29,7 @@
using std::ofstream;
using namespace blocxx;
-int assert_dir( const String & spath)
+int assert_dir( const std::string & spath)
{
size_t pos, lastpos = 0;
int ret = 0;
@@ -39,15 +39,15 @@
// skip ./
if(spath.length() > 2 &&
- spath.substring(0,2) == "./")
+ spath.substr(0,2) == "./")
lastpos=2;
// skip /
else if (spath[0] == '/')
lastpos=1;
- while((pos = spath.indexOf('/',lastpos)) != String::npos )
+ while((pos = spath.find_first_of('/',lastpos)) != std::string::npos )
{
- String dir = spath.substring(0,pos);
+ std::string dir = spath.substr(0,pos);
ret = ::mkdir(dir.c_str(), 0755);
if(ret == -1)
{
@@ -70,7 +70,7 @@
/**
* Debugging.
*/
-void printPath(const std::vectorblocxx::String&p, const char*c = "")
+void printPath(const std::vectorstd::string&p, const char*c = "")
{
int i = 0;
int len = p.size();
@@ -93,7 +93,7 @@
-void IniParser::initFiles (const std::vectorblocxx::String&f)
+void IniParser::initFiles (const std::vectorstd::string&f)
{
multiple_files = true;
files.clear ();
@@ -107,12 +107,12 @@
file = fn;
multiple_files = false;
}
-void IniParser::initOptions (const std::vectorblocxx::String&options)
+void IniParser::initOptions (const std::vectorstd::string&options)
{
int len = options.size();
for (int i = 0;iblocxx::String&comm)
+void IniParser::initComments (const std::vectorstd::string&comm)
{
int len = comm.size();
linecomments.clear ();
@@ -171,7 +171,7 @@
comments.reserve (len);
for (int i = 0; i < len; i++)
{
- String s = comm[i];
+ std::string s = comm[i];
std::vector<PosixRegEx> & regexes = ('^' == s[0]) ?
linecomments : comments;
PosixRegEx r;
@@ -199,7 +199,7 @@
if (!s.end.rx.compile (end.regExpr,
REG_EXTENDED | (ignore_case ? REG_ICASE : 0)))
continue;
- s.end.out = String (end.out);
+ s.end.out = std::string (end.out);
}
IoPatternDescr begin = m.begin;
if (!s.begin.rx.compile (begin.regExpr,
@@ -208,7 +208,7 @@
// compile failed
continue;
}
- s.begin.out = String(begin.out);
+ s.begin.out = std::string(begin.out);
sections.push_back (s);
}
}
@@ -245,7 +245,7 @@
}
}
- if (!pa.line.rx.compile ( String (entry.line.regExpr),
+ if (!pa.line.rx.compile ( std::string (entry.line.regExpr),
REG_EXTENDED | (ignore_case ? REG_ICASE : 0)))
{
if (pa.multiline_valid)
@@ -257,7 +257,7 @@
}
else
{
- pa.line.out = String (entry.line.out);
+ pa.line.out = std::string (entry.line.out);
params.push_back (pa);
}
}
@@ -277,19 +277,19 @@
scanner.close();
scanner.clear();
}
-int IniParser::scanner_get(String&s)
+int IniParser::scanner_get(std::string&s)
{
if (!scanner)
return -1;
- s = String::getLine (scanner);
+ s = str::getline (scanner);
scanner_line++;
if (line_can_continue && s.length ())
{
- String tmp;
+ std::string tmp;
while (s[s.length()-1] == '\\')
{
- tmp = String::getLine (scanner);
+ tmp = str::getline (scanner);
scanner_line++;
s = s + "\n" + tmp;
}
@@ -298,14 +298,14 @@
}
#define scanner_error(format,args...) \
- LIMAL_LOG_ERROR (logger, blocxx::Format( "%1:%2 " format, scanner_file.c_str (), scanner_line, ##args))
+ LIMAL_LOG_ERROR (logger, str::form( "%s:%d " format, scanner_file.c_str (), scanner_line, ##args).c_str())
-void StripLine (String&l, regmatch_t&r)
+void StripLine (std::string&l, regmatch_t&r)
{
- String out;
+ std::string out;
if (r.rm_so>1)
- out = l.substring (0,r.rm_so);
- out = out + l.substring(r.rm_eo);
+ out = l.substr (0,r.rm_so);
+ out = out + l.substr(r.rm_eo);
l = out;
}
@@ -363,7 +363,7 @@
for (unsigned int i = 0;i::iterator ff = multi_files.find (*f);
+ std::mapstd::string,FileDescr::iterator ff = multi_files.find (*f);
if (ff == multi_files.end())
{
// new file
@@ -429,17 +429,17 @@
int IniParser::parse_helper(IniSection&ini)
{
- String comment = "";
- String key = "";
- String val = "";
+ std::string comment = "";
+ std::string key = "";
+ std::string val = "";
int state = 0; // 1: precessing a multiline value
int matched_by = -1;
- String line;
+ std::string line;
size_t i;
// stack of section names
- std::vectorblocxx::String path;
+ std::vectorstd::string path;
//
// read line
@@ -495,7 +495,7 @@
{ // we are in toplevel section, going deeper
// check for toplevel values allowance
if (!global_values)
- scanner_error ("%3: values at the top level not allowed.", key.c_str ());
+ scanner_error ("%s: values at the top level not allowed.", key.c_str ());
else
ini.initValue (key, val, comment, matched_by);
}
@@ -514,7 +514,7 @@
// check for section begin
//
{
- String found;
+ std::string found;
for (i = 0; i < sections.size (); i++)
{
@@ -536,7 +536,7 @@
{
if(no_nested_sections)
{
- scanner_error ("Section %3 started but section %4 is not finished",
+ scanner_error ("Section %s started but section %s is not finished",
found.c_str(),
path[path.size()-1].c_str());
path.pop_back();
@@ -552,7 +552,7 @@
else
{
if (no_nested_sections)
- scanner_error ("Attempt to create nested section %3.", found.c_str ());
+ scanner_error ("Attempt to create nested section %s.", found.c_str ());
else
{
ini.findSection(path).initSection(found, comment, i);
@@ -567,7 +567,7 @@
// check for section end
//
{
- String found;
+ std::string found;
for (i = 0; i < sections.size (); i++)
{
@@ -617,7 +617,7 @@
{
toclose = m - 1;
}
- scanner_error ("Unexpected closing %3. Closing section %4.", found.c_str(), path[toclose].c_str());
+ scanner_error ("Unexpected closing %s. Closing section %s.", found.c_str(), path[toclose].c_str());
path.resize (toclose);
}
}
@@ -640,7 +640,7 @@
// check for line
//
{
- String key,val;
+ std::string key,val;
for (i = 0; i < params.size (); i++)
{
RegexMatch m (params[i].line.rx, line);
@@ -658,7 +658,7 @@
{ // we are in toplevel section, going deeper
// check for toplevel values allowance
if (!global_values)
- scanner_error ("%3: values at the top level not allowed.", key.c_str ());
+ scanner_error ("%s: values at the top level not allowed.", key.c_str ());
else
ini.initValue (key, val, comment, i);
}
@@ -714,7 +714,7 @@
//
{
if (!onlySpaces (line.c_str()))
- scanner_error ("Extra characters: %3", line.c_str ());
+ scanner_error ("Extra characters: %s", line.c_str ());
}
}
}
@@ -791,7 +791,7 @@
}
int bugs = 0;
- String filename = multiple_files ? files[0] : file;
+ std::string filename = multiple_files ? files[0] : file;
if (!inifile.isDirty())
{
LIMAL_SLOG_DEBUG (logger, "File " << filename << " did not change. Not saving." );
@@ -816,7 +816,7 @@
{
IniSection&s = ci->s ();
int wb = s.getRewriteBy (); // bug #19066
- String filename = getFileName (s.getName (), wb);
+ std::string filename = getFileName (s.getName (), wb);
if (!s.isDirty ()) {
LIMAL_SLOG_DEBUG (logger, "Skipping file " << filename.c_str() << " that was not changed." );
@@ -864,8 +864,8 @@
int IniParser::write_helper(IniSection&ini, ofstream&of, int depth)
{
char out_buffer[2048];
- String indent;
- String indent2;
+ std::string indent;
+ std::string indent2;
int readby = ini.getReadBy ();
if (!subindent.empty ())
{
@@ -916,9 +916,9 @@
ini.clean();
return 0;
}
-String IniParser::getFileName (const String&sec, int rb)
+std::string IniParser::getFileName (const std::string&sec, int rb)
{
- String file = sec;
+ std::string file = sec;
if (-1 != rb && (int) rewrites.size () > rb)
{
int max = rewrites[rb].out.length () + sec.length () + 1;
@@ -932,22 +932,22 @@
}
/**
- * change case of String
- * @param str String to change
- * @return changed String
+ * change case of std::string
+ * @param str std::string to change
+ * @return changed std::string
*/
-String IniParser::changeCase (const String&str) const
+std::string IniParser::changeCase (const std::string&str) const
{
- String tmp = str;
+ std::string tmp = str;
if (!ignore_case)
return tmp;
if (prefer_uppercase)
{
- tmp.toUpperCase();
+ tmp = str::toUpper(tmp);
}
else
{
- tmp.toLowerCase();
+ tmp = str::toLower(tmp);
if (first_upper
&& tmp.length() > 0)
{
Modified: limal-branches/mc-devel/limal-ca-mgm/src/INIParser/IniParser.h
URL: http://svn.opensuse.org/viewcvs/limal/limal-branches/mc-devel/limal-ca-mgm/src/INIParser/IniParser.h?rev=2675&r1=2674&r2=2675&view=diff
==============================================================================
--- limal-branches/mc-devel/limal-ca-mgm/src/INIParser/IniParser.h (original)
+++ limal-branches/mc-devel/limal-ca-mgm/src/INIParser/IniParser.h Sat Jul 3 13:27:18 2010
@@ -17,8 +17,8 @@
#include
#include
#include
-#include
-#include
+#include
+#include
#include
#include <iosfwd>
@@ -40,12 +40,12 @@
{
public:
/** Matched subexpressions (0 - the whole regex) */
- std::vectorblocxx::String matches;
+ std::vectorstd::string matches;
/** The unmatched part of the String */
- blocxx::String rest;
+ std::string rest;
/** @return i-th match */
- const blocxx::String& operator[] (size_t i) { return matches[i]; }
+ const std::string& operator[] (size_t i) { return matches[i]; }
/** did the String match */
operator bool () { return matches.size () > 0; }
@@ -54,13 +54,13 @@
* @param s a String to match
* @param nmatch how many rm_matches to reserve
*/
- RegexMatch (blocxx::PosixRegEx& rx, const blocxx::String& s) {
- blocxx::PosixRegEx::MatchArray rm_matches;
+ RegexMatch (PosixRegEx& rx, const std::string& s) {
+ PosixRegEx::MatchArray rm_matches;
if( rx.execute(rm_matches, s) && !rm_matches.empty())
{
// match
- rest = s.substring (0, rm_matches[0].rm_so) +
- s.substring (rm_matches[0].rm_eo);
+ rest = s.substr (0, rm_matches[0].rm_so) +
+ s.substr (rm_matches[0].rm_eo);
}
else
{
@@ -69,7 +69,7 @@
}
for (size_t i = 0; i < rm_matches.size() ; ++i)
{
- matches.push_back (s.substring (rm_matches[i].rm_so,
+ matches.push_back (s.substr (rm_matches[i].rm_so,
rm_matches[i].rm_eo - rm_matches[i].rm_so));
}
}
@@ -81,8 +81,8 @@
*/
struct IoPattern
{
- blocxx::PosixRegEx rx;
- blocxx::String out;
+ PosixRegEx rx;
+ std::string out;
};
/**
@@ -103,9 +103,9 @@
/** single-line values, the normal case */
IoPattern line;
/** multiline begin */
- blocxx::PosixRegEx begin;
+ PosixRegEx begin;
/** multiline end */
- blocxx::PosixRegEx end;
+ PosixRegEx end;
/** was multiline specified*/
bool multiline_valid;
};
@@ -115,11 +115,11 @@
/**
* File name
*/
- blocxx::String fn;
+ std::string fn;
/**
* Section name
*/
- blocxx::String sn;
+ std::string sn;
/**
* Time of the last modification
*/
@@ -143,11 +143,11 @@
* Times of last modification of read files, used in multiple files
* mode.
*/
- std::mapblocxx::String,FileDescr multi_files;
+ std::mapstd::string,FileDescr multi_files;
/**
* File name of the ini file -- single file mode only.
*/
- blocxx::String file;
+ std::string file;
/**
* Get time stamp of file in sinble file mode.
*/
@@ -183,15 +183,15 @@
bool flat;
/** this String is printed before each line in subsections */
- blocxx::String subindent;
+ std::string subindent;
/**
* Regular expression for comments over whole line.
*/
- std::vectorblocxx::PosixRegEx linecomments;
+ std::vector<PosixRegEx> linecomments;
/**
* Regular expressions for comments over part of the line.
*/
- std::vectorblocxx::PosixRegEx comments;
+ std::vector<PosixRegEx> comments;
/**
* Regular expressions for sections.
*/
@@ -212,7 +212,7 @@
/**
* name of scanned file
*/
- blocxx::String scanner_file;
+ std::string scanner_file;
/**
* line number of scanned file
*/
@@ -231,7 +231,7 @@
/**
* Array of globe-expressions.
*/
- std::vectorblocxx::String files;
+ std::vectorstd::string files;
/**
* Open ini file.
@@ -244,7 +244,7 @@
/**
* get line from ini file.
*/
- int scanner_get(blocxx::String&s);
+ int scanner_get(std::string&s);
/**
* Parse one ini file and build a structure of IniSection.
@@ -287,11 +287,11 @@
* Sets parser to multiple file mode and sets the glob-expressions.
* @param f list of glob-expressions
*/
- void initFiles (const std::vectorblocxx::String&f);
+ void initFiles (const std::vectorstd::string&f);
/**
* Sets flags and regular expressions.
*/
- void initOptions (const std::vectorblocxx::String&options);
+ void initOptions (const std::vectorstd::string&options);
/**
* Sets flags and regular expressions.
*/
@@ -299,11 +299,11 @@
/**
* Sets flags and regular expressions.
*/
- void initSubident (const blocxx::String ident);
+ void initSubident (const std::string ident);
/**
* Sets flags and regular expressions.
*/
- void initComments (const std::vectorblocxx::String&comm);
+ void initComments (const std::vectorstd::string&comm);
/**
* Sets flags and regular expressions.
*/
@@ -354,7 +354,7 @@
* @param rb index of rewrite rule
* @return rewritten file name
*/
- blocxx::String getFileName (const blocxx::String&sec, int rb);
+ std::string getFileName (const std::string&sec, int rb);
/**
* Using file name rewriting?
*/
@@ -370,7 +370,7 @@
* @param str String to change
* @return changed String
*/
- blocxx::String changeCase (const blocxx::String&str) const;
+ std::string changeCase (const std::string&str) const;
};
} // End of INI namespace
Modified: limal-branches/mc-devel/limal-ca-mgm/src/IssuerAlternativeNameExtension.cpp
URL: http://svn.opensuse.org/viewcvs/limal/limal-branches/mc-devel/limal-ca-mgm/src/IssuerAlternativeNameExtension.cpp?rev=2675&r1=2674&r2=2675&view=diff
==============================================================================
--- limal-branches/mc-devel/limal-ca-mgm/src/IssuerAlternativeNameExtension.cpp (original)
+++ limal-branches/mc-devel/limal-ca-mgm/src/IssuerAlternativeNameExtension.cpp Sat Jul 3 13:27:18 2010
@@ -75,7 +75,7 @@
: ExtensionBase()
, m_impl(new IssuerAlternativeNameExtImpl(copyIssuer, alternativeNameList))
{
- std::vectorblocxx::String r = checkLiteralValueList(alternativeNameList);
+ std::vectorstd::string r = checkLiteralValueList(alternativeNameList);
if(!r.empty())
{
LOGIT_ERROR(r[0]);
@@ -93,22 +93,22 @@
{
LOGIT_ERROR("wrong type" << type);
BLOCXX_THROW(ca_mgm::ValueException,
- Format(__("Wrong type: %1."), type).c_str());
+ str::form(__("Wrong type: %1."), type).c_str());
}
bool p = caConfig->exists(type2Section(type, true), "issuerAltName");
if(p)
{
- std::vectorblocxx::String sp = convStringArray(PerlRegEx("\\s*,\\s*")
- .split(caConfig->getValue(type2Section(type, true), "issuerAltName")));
- if(sp[0].equalsIgnoreCase("critical")) setCritical(true);
+ std::vectorstd::string sp = PerlRegEx("\\s*,\\s*")
+ .split(caConfig->getValue(type2Section(type, true), "issuerAltName"));
+ if(0 == str::compareCI(sp[0], "critical")) setCritical(true);
- std::vectorblocxx::String::const_iterator it = sp.begin();
+ std::vectorstd::string::const_iterator it = sp.begin();
for(; it != sp.end(); ++it)
{
- if((*it).indexOf(":") != String::npos)
+ if((*it).find_first_of(":") != std::string::npos)
{
- if((*it).equalsIgnoreCase("issuer:copy"))
+ if(0 == str::compareCI(*it, "issuer:copy"))
m_impl->issuerCopy = true;
else
{
@@ -169,7 +169,7 @@
void
IssuerAlternativeNameExt::setAlternativeNameList(const std::list<LiteralValue> &alternativeNameList)
{
- std::vectorblocxx::String r = checkLiteralValueList(alternativeNameList);
+ std::vectorstd::string r = checkLiteralValueList(alternativeNameList);
if(!r.empty())
{
LOGIT_ERROR(r[0]);
@@ -219,18 +219,18 @@
{
LOGIT_ERROR("wrong type" << type);
BLOCXX_THROW(ca_mgm::ValueException,
- Format(__("Wrong type: %1."), type).c_str());
+ str::form(__("Wrong type: %d."), type).c_str());
}
if(isPresent())
{
- String extString;
+ std::string extString;
if(isCritical()) extString += "critical,";
if(m_impl->issuerCopy) extString += "issuer:copy,";
- String val;
+ std::string val;
std::list<LiteralValue>::const_iterator it = m_impl->altNameList.begin();
for(int j = 0;it != m_impl->altNameList.end(); ++it, ++j)
{
@@ -264,7 +264,7 @@
LOGIT_DEBUG("return IssuerAlternativeNameExt::valid() is false");
return false;
}
- std::vectorblocxx::String r = checkLiteralValueList(m_impl->altNameList);
+ std::vectorstd::string r = checkLiteralValueList(m_impl->altNameList);
if(!r.empty())
{
LOGIT_DEBUG(r[0]);
@@ -274,16 +274,16 @@
return true;
}
-std::vectorblocxx::String
+std::vectorstd::string
IssuerAlternativeNameExt::verify() const
{
- std::vectorblocxx::String result;
+ std::vectorstd::string result;
if(!isPresent()) return result;
if(!m_impl->issuerCopy && m_impl->altNameList.empty())
{
- result.push_back(String("invalid value for IssuerAlternativeNameExt"));
+ result.push_back(std::string("invalid value for IssuerAlternativeNameExt"));
}
appendArray(result, checkLiteralValueList(m_impl->altNameList));
@@ -292,16 +292,16 @@
return result;
}
-std::vectorblocxx::String
+std::vectorstd::string
IssuerAlternativeNameExt::dump() const
{
- std::vectorblocxx::String result;
+ std::vectorstd::string result;
result.push_back("IssuerAlternativeNameExt::dump()");
appendArray(result, ExtensionBase::dump());
if(!isPresent()) return result;
- result.push_back("Issuer:copy = " + Bool(m_impl->issuerCopy).toString());
+ result.push_back("Issuer:copy = " + str::toString(m_impl->issuerCopy));
std::list< LiteralValue >::const_iterator it = m_impl->altNameList.begin();
for(; it != m_impl->altNameList.end(); ++it)
Modified: limal-branches/mc-devel/limal-ca-mgm/src/LDAPUrlImpl.cpp
URL: http://svn.opensuse.org/viewcvs/limal/limal-branches/mc-devel/limal-ca-mgm/src/LDAPUrlImpl.cpp?rev=2675&r1=2674&r2=2675&view=diff
==============================================================================
--- limal-branches/mc-devel/limal-ca-mgm/src/LDAPUrlImpl.cpp (original)
+++ limal-branches/mc-devel/limal-ca-mgm/src/LDAPUrlImpl.cpp Sat Jul 3 13:27:18 2010
@@ -17,8 +17,8 @@
/-*/
-#include
-#include
+#include
+#include
#include "LDAPUrlImpl.hpp"
#include "Utils.hpp"
@@ -30,9 +30,6 @@
namespace url
{
-using namespace blocxx;
-
-
// ---------------------------------------------------------------
LDAPUrlImpl::LDAPUrlImpl()
: UrlBase()
@@ -53,10 +50,10 @@
}
// -------------------------------------------------------------------
-std::vectorblocxx::String
+std::vectorstd::string
LDAPUrlImpl::getKnownSchemes() const
{
- std::vectorblocxx::String schemes(2);
+ std::vectorstd::string schemes(2);
schemes[0] = "ldap";
schemes[1] = "ldaps";
return schemes;
@@ -90,7 +87,7 @@
"attrs", "scope", "filter", "exts", NULL
};
ca_mgm::url::ParamMap pmap;
- std::vectorblocxx::String parr( getQueryStringArray());
+ std::vectorstd::string parr( getQueryStringArray());
if( parr.size() <= 4)
{
for(size_t i=0; iblocxx::String parr(4);
+ std::vectorstd::string parr(4);
ca_mgm::url::ParamMap::const_iterator p;
for(p=pmap.begin(); p!=pmap.end(); ++p)
{
Modified: limal-branches/mc-devel/limal-ca-mgm/src/LDAPUrlImpl.hpp
URL: http://svn.opensuse.org/viewcvs/limal/limal-branches/mc-devel/limal-ca-mgm/src/LDAPUrlImpl.hpp?rev=2675&r1=2674&r2=2675&view=diff
==============================================================================
--- limal-branches/mc-devel/limal-ca-mgm/src/LDAPUrlImpl.hpp (original)
+++ limal-branches/mc-devel/limal-ca-mgm/src/LDAPUrlImpl.hpp Sat Jul 3 13:27:18 2010
@@ -40,7 +40,7 @@
virtual UrlBase *
clone() const;
- virtual std::vectorblocxx::String
+ virtual std::vectorstd::string
getKnownSchemes() const;
virtual void
Modified: limal-branches/mc-devel/limal-ca-mgm/src/LiteralValues.cpp
URL: http://svn.opensuse.org/viewcvs/limal/limal-branches/mc-devel/limal-ca-mgm/src/LiteralValues.cpp?rev=2675&r1=2674&r2=2675&view=diff
==============================================================================
--- limal-branches/mc-devel/limal-ca-mgm/src/LiteralValues.cpp (original)
+++ limal-branches/mc-devel/limal-ca-mgm/src/LiteralValues.cpp Sat Jul 3 13:27:18 2010
@@ -24,7 +24,7 @@
#include
#include
#include
-#include
+#include
#include
#include "Utils.hpp"
@@ -39,15 +39,15 @@
class LiteralValueImpl : public blocxx::COWIntrusiveCountableBase
{
public:
- String literalType;
- String literalValue;
+ std::string literalType;
+ std::string literalValue;
LiteralValueImpl()
- : literalType(String()), literalValue(String())
+ : literalType(std::string()), literalValue(std::string())
{}
- LiteralValueImpl(const String& type,
- const String& value)
+ LiteralValueImpl(const std::string& type,
+ const std::string& value)
: literalType(type), literalValue(value)
{}
@@ -70,10 +70,10 @@
: m_impl(new LiteralValueImpl())
{}
-LiteralValue::LiteralValue(const String &type, const String &value)
+LiteralValue::LiteralValue(const std::string &type, const std::string &value)
: m_impl(new LiteralValueImpl(type, value))
{
- std::vectorblocxx::String r = this->verify();
+ std::vectorstd::string r = this->verify();
if(!r.empty())
{
LOGIT_ERROR(r[0]);
@@ -81,42 +81,42 @@
}
}
-LiteralValue::LiteralValue(const String& value)
+LiteralValue::LiteralValue(const std::string& value)
: m_impl(new LiteralValueImpl())
{
- std::vectorblocxx::String sp = convStringArray(PerlRegEx("^([\\w\\d.]+):(.*)$").capture(value));
+ std::vectorstd::string sp = PerlRegEx("^([\\w\\d.]+):(.*)$").capture(value);
- if(sp[1].equalsIgnoreCase("email"))
+ if(str::compareCI(sp[1], "email") == 0)
{
m_impl->literalType = sp[1];
m_impl->literalValue = sp[2];
}
- else if(sp[1].equalsIgnoreCase("URI"))
+ else if(str::compareCI(sp[1], "URI") == 0)
{
m_impl->literalType = sp[1];
m_impl->literalValue = sp[2];
}
- else if(sp[1].equalsIgnoreCase("DNS"))
+ else if(str::compareCI(sp[1], "DNS") == 0)
{
m_impl->literalType = sp[1];
m_impl->literalValue = sp[2];
}
- else if(sp[1].equalsIgnoreCase("RID"))
+ else if(str::compareCI(sp[1], "RID") == 0)
{
m_impl->literalType = sp[1];
m_impl->literalValue = sp[2];
}
- else if(sp[1].equalsIgnoreCase("IP"))
+ else if(str::compareCI(sp[1], "IP") == 0)
{
m_impl->literalType = sp[1];
m_impl->literalValue = sp[2];
}
- else if(sp[1].equals("1.3.6.1.4.1.311.20.2.3")) // ms_upn
+ else if(sp[1] == "1.3.6.1.4.1.311.20.2.3") // ms_upn
{
m_impl->literalType = sp[1];
m_impl->literalValue = sp[2];
}
- else if(sp[1].equals("1.3.6.1.5.2.2")) // KRB5PrincipalName
+ else if(sp[1] == "1.3.6.1.5.2.2") // KRB5PrincipalName
{
m_impl->literalType = sp[1];
m_impl->literalValue = sp[2];
@@ -149,15 +149,15 @@
void
-LiteralValue::setLiteral(const String &type, const String &value)
+LiteralValue::setLiteral(const std::string &type, const std::string &value)
{
- String dType = m_impl->literalType;
- String dValue = m_impl->literalValue;
+ std::string dType = m_impl->literalType;
+ std::string dValue = m_impl->literalValue;
m_impl->literalType = type;
m_impl->literalValue = value;
- std::vectorblocxx::String r = this->verify();
+ std::vectorstd::string r = this->verify();
if(!r.empty())
{
m_impl->literalType = dType;
@@ -169,13 +169,13 @@
}
void
-LiteralValue::setValue(const String &value)
+LiteralValue::setValue(const std::string &value)
{
- String dValue = m_impl->literalValue;
+ std::string dValue = m_impl->literalValue;
m_impl->literalValue = value;
- std::vectorblocxx::String r = this->verify();
+ std::vectorstd::string r = this->verify();
if(!r.empty())
{
m_impl->literalValue = dValue;
@@ -185,20 +185,20 @@
}
}
-blocxx::String
+std::string
LiteralValue::getValue() const
{
return m_impl->literalValue;
}
-blocxx::String
+std::string
LiteralValue::getType() const
{
return m_impl->literalType;
}
-blocxx::String
-LiteralValue::commit2Config(CA &ca, Type t, uint32_t num) const
+std::string
+LiteralValue::commit2Config(CA &ca, Type, uint32_t num) const
{
if(m_impl->literalType == "email" ||
@@ -246,12 +246,13 @@
}
else if(m_impl->literalType == "1.3.6.1.5.2.2") // KRB5PrincipalName
{
- String primary = "";
- String instance;
- String realm = "";
-
- std::vectorblocxx::String sa = convStringArray(getValue().tokenize("@/"));
- String sectname1 = getValue()+String(num);
+ std::string primary = "";
+ std::string instance;
+ std::string realm = "";
+
+ std::vectorstd::string sa;
+ str::split( getValue(), std::back_inserter(sa) ,"@/");
+ std::string sectname1 = getValue()+str::numstring(num);
if(sa.size() == 2) // primary@REALM
{
@@ -269,10 +270,10 @@
// FIXME: or better throw an error?
return "";
}
- String sectname2 = primary+instance+String(num);
- String sectname3 = "basic"+primary+instance+String(num);
+ std::string sectname2 = primary+instance+str::numstring(num);
+ std::string sectname3 = "basic"+primary+instance+str::numstring(num);
- String ret = "otherName:1.3.6.1.5.2.2;SEQUENCE:"+sectname1;
+ std::string ret = "otherName:1.3.6.1.5.2.2;SEQUENCE:"+sectname1;
ca.getConfig()->setValue(sectname1, "realm", "EXPLICIT:0, GeneralString:"+realm);
ca.getConfig()->setValue(sectname1, "kerberosname", "EXPLICIT:1, SEQUENCE:"+sectname2);
@@ -375,10 +376,10 @@
return true;
}
-std::vectorblocxx::String
+std::vectorstd::string
LiteralValue::verify() const
{
- std::vectorblocxx::String result;
+ std::vectorstd::string result;
if(m_impl->literalType == "email")
{
@@ -386,8 +387,8 @@
if(!check.isValid(m_impl->literalValue))
{
LOGIT_DEBUG("Wrong LiteralValue for type 'email': " << m_impl->literalValue);
- result.push_back(Format("Wrong LiteralValue for type 'email': %1",
- m_impl->literalValue).toString());
+ result.push_back(str::form("Wrong LiteralValue for type 'email': %s",
+ m_impl->literalValue.c_str()));
}
}
else if(m_impl->literalType == "URI")
@@ -396,8 +397,8 @@
if(!check.isValid(m_impl->literalValue))
{
LOGIT_DEBUG("Wrong LiteralValue for type 'URI': " << m_impl->literalValue);
- result.push_back(Format("Wrong LiteralValue for type 'URI': %1",
- m_impl->literalValue).toString());
+ result.push_back(str::form("Wrong LiteralValue for type 'URI': %s",
+ m_impl->literalValue.c_str()));
}
}
else if(m_impl->literalType == "DNS")
@@ -406,8 +407,8 @@
if(!check.isValid(m_impl->literalValue))
{
LOGIT_DEBUG("Wrong LiteralValue for type 'DNS': " << m_impl->literalValue);
- result.push_back(Format("Wrong LiteralValue for type 'DNS': %1",
- m_impl->literalValue).toString());
+ result.push_back(str::form("Wrong LiteralValue for type 'DNS': %s",
+ m_impl->literalValue.c_str()));
}
}
else if(m_impl->literalType == "RID")
@@ -416,8 +417,8 @@
if(!check.isValid(m_impl->literalValue))
{
LOGIT_DEBUG("Wrong LiteralValue for type 'RID': " << m_impl->literalValue);
- result.push_back(Format("Wrong LiteralValue for type 'RID': %1",
- m_impl->literalValue).toString());
+ result.push_back(str::form("Wrong LiteralValue for type 'RID': %s",
+ m_impl->literalValue.c_str()));
}
}
else if(m_impl->literalType == "IP")
@@ -430,8 +431,8 @@
if(!check.isValid(m_impl->literalValue))
{
LOGIT_DEBUG("Wrong LiteralValue for type 'IP': " << m_impl->literalValue);
- result.push_back(Format("Wrong LiteralValue for type 'IP': %1",
- m_impl->literalValue).toString());
+ result.push_back(str::form("Wrong LiteralValue for type 'IP': %s",
+ m_impl->literalValue.c_str()));
}
}
}
@@ -441,8 +442,8 @@
if(!check.isValid(m_impl->literalValue))
{
LOGIT_DEBUG("Wrong LiteralValue for type '1.3.6.1.4.1.311.20.2.3': " << m_impl->literalValue);
- result.push_back(Format("Wrong LiteralValue for type '1.3.6.1.4.1.311.20.2.3': %1",
- m_impl->literalValue).toString());
+ result.push_back(str::form("Wrong LiteralValue for type '1.3.6.1.4.1.311.20.2.3': %s",
+ m_impl->literalValue.c_str()));
}
}
else if(m_impl->literalType == "1.3.6.1.5.2.2") // KRB5PrincipalName
@@ -451,8 +452,8 @@
if(!check.isValid(m_impl->literalValue))
{
LOGIT_DEBUG("Wrong LiteralValue for type '1.3.6.1.5.2.2': " << m_impl->literalValue);
- result.push_back(Format("Wrong LiteralValue for type '1.3.6.1.5.2.2': %1",
- m_impl->literalValue).toString());
+ result.push_back(str::form("Wrong LiteralValue for type '1.3.6.1.5.2.2': %s",
+ m_impl->literalValue.c_str()));
}
}
else if(m_impl->literalType == "othername" ||
@@ -464,22 +465,22 @@
else
{
LOGIT_DEBUG("Unknown Type in LiteralValue: " << m_impl->literalType);
- result.push_back(Format("Unknown Type in LiteralValue: %1",
- m_impl->literalType).toString());
+ result.push_back(str::form("Unknown Type in LiteralValue: %s",
+ m_impl->literalType.c_str()));
}
return result;
}
-blocxx::String
+std::string
LiteralValue::toString() const
{
return (m_impl->literalType + ":" + m_impl->literalValue);
}
-std::vectorblocxx::String
+std::vectorstd::string
LiteralValue::dump() const
{
- std::vectorblocxx::String result;
+ std::vectorstd::string result;
result.push_back("LiteralValue::dump()");
result.push_back(m_impl->literalType + ":" + m_impl->literalValue);
Modified: limal-branches/mc-devel/limal-ca-mgm/src/LiteralValues_Priv.cpp
URL: http://svn.opensuse.org/viewcvs/limal/limal-branches/mc-devel/limal-ca-mgm/src/LiteralValues_Priv.cpp?rev=2675&r1=2674&r2=2675&view=diff
==============================================================================
--- limal-branches/mc-devel/limal-ca-mgm/src/LiteralValues_Priv.cpp (original)
+++ limal-branches/mc-devel/limal-ca-mgm/src/LiteralValues_Priv.cpp Sat Jul 3 13:27:18 2010
@@ -62,13 +62,13 @@
IMPLEMENT_ASN1_FUNCTIONS(KRB5_NAME);
IMPLEMENT_ASN1_FUNCTIONS(KRB5_PRINC_NAME);
-String asn1string2string(ASN1_STRING* str)
+std::string asn1string2string(ASN1_STRING* str)
{
char *s = new char[str->length +1];
memcpy(s, str->data, str->length);
s[str->length] = '\0';
- String ret(s);
+ std::string ret(s);
delete [] s;
return ret;
@@ -173,7 +173,7 @@
else
{
setLiteral("othername",
- String("unsupported(") + String(OBJ_obj2nid(gen->d.otherName->type_id)) + ")");
+ std::string("unsupported(") + str::numstring(OBJ_obj2nid(gen->d.otherName->type_id)) + ")");
}
break;
case GEN_X400:
@@ -207,11 +207,11 @@
//ERR_print_errors_fp(stderr);
LOGIT_ERROR("Unable to decode KRB5PrincipalName");
- setLiteral("othername", String("unsupported(1.3.6.1.5.2.2)"));
+ setLiteral("othername", std::string("unsupported(1.3.6.1.5.2.2)"));
return;
}
- String principal = "";
+ std::string principal = "";
for(int i = 0; i < sk_ASN1_GENERALSTRING_num(pname->kerberosname->namelist); i++)
{
Modified: limal-branches/mc-devel/limal-ca-mgm/src/LocalManagement.cpp
URL: http://svn.opensuse.org/viewcvs/limal/limal-branches/mc-devel/limal-ca-mgm/src/LocalManagement.cpp?rev=2675&r1=2674&r2=2675&view=diff
==============================================================================
--- limal-branches/mc-devel/limal-ca-mgm/src/LocalManagement.cpp (original)
+++ limal-branches/mc-devel/limal-ca-mgm/src/LocalManagement.cpp Sat Jul 3 13:27:18 2010
@@ -43,20 +43,19 @@
using namespace blocxx;
namespace {
-inline blocxx::String errno2String(int e) {
+inline std::string errno2String(int e) {
// FIXME: make strerror working
-blocxx::String s = System::errorMsg(e);
-s = "(" + blocxx::String(e) + ")";
+std::string s = "(" + std::string(::strerror(e)) + ")";
return s;
}
}
void
-LocalManagement::importAsLocalCertificate(const String &pkcs12File,
- const String &password,
- const String &destinationCAsDir,
- const String &destinationCertFile,
- const String &destinationKeyFile)
+LocalManagement::importAsLocalCertificate(const std::string &pkcs12File,
+ const std::string &password,
+ const std::string &destinationCAsDir,
+ const std::string &destinationCertFile,
+ const std::string &destinationKeyFile)
{
importAsLocalCertificate(readFile(pkcs12File),
@@ -67,24 +66,24 @@
void
LocalManagement::importAsLocalCertificate(const ByteBuffer &pkcs12Data,
- const String &password,
- const String &destinationCAsDir,
- const String &destinationCertFile,
- const String &destinationKeyFile)
+ const std::string &password,
+ const std::string &destinationCAsDir,
+ const std::string &destinationCertFile,
+ const std::string &destinationKeyFile)
{
ByteBuffer out = OpenSSLUtils::pkcs12ToPEM(pkcs12Data, password, "");
- String data(out.data(), out.size());
+ std::string data(out.data(), out.size());
- std::vector< std::map > list;
+ std::vector< std::map > list;
- String info;
- String cert;
- String subject;
- String issuer;
- String keyID;
+ std::string info;
+ std::string cert;
+ std::string subject;
+ std::string issuer;
+ std::string keyID;
- std::vectorblocxx::String dataList = convStringArray(PerlRegEx("\n").split(data));
+ std::vectorstd::string dataList = PerlRegEx("\n").split(data);
if(dataList.size() <= 1) {
@@ -100,7 +99,7 @@
PerlRegEx subjectRegex("^subject=(.*)\\s*$");
PerlRegEx issuerRegex("^issuer=(.*)\\s*$");
- std::vectorblocxx::String::const_iterator lineIT = dataList.begin() + 1;
+ std::vectorstd::string::const_iterator lineIT = dataList.begin() + 1;
for(; lineIT != dataList.end(); ++lineIT) {
@@ -110,10 +109,10 @@
if(endRegex.match(*lineIT)) {
- std::vectorblocxx::String ia = convStringArray(endRegex.capture(*lineIT));
+ std::vectorstd::string ia = endRegex.capture(*lineIT);
if(ia.size() == 2 && ia[1] == info) {
- std::map v;
+ std::map v;
v["info"] = info;
v["data"] = cert;
v["keyID"] = keyID;
@@ -140,7 +139,7 @@
if(beginRegex.match(*lineIT)) {
- std::vectorblocxx::String ia = convStringArray(beginRegex.capture(*lineIT));
+ std::vectorstd::string ia = beginRegex.capture(*lineIT);
if(ia.size() == 2 ) {
info = ia[1];
@@ -154,7 +153,7 @@
if(keyIDRegex.match(*lineIT)) {
- std::vectorblocxx::String ia = convStringArray(keyIDRegex.capture(*lineIT));
+ std::vectorstd::string ia = keyIDRegex.capture(*lineIT);
if(ia.size() == 2 ) {
keyID = ia[1];
@@ -165,7 +164,7 @@
}
} else if(subjectRegex.match(*lineIT)) {
- std::vectorblocxx::String ia = convStringArray(subjectRegex.capture(*lineIT));
+ std::vectorstd::string ia = subjectRegex.capture(*lineIT);
if(ia.size() == 2 ) {
subject = ia[1];
@@ -176,7 +175,7 @@
}
} else if(issuerRegex.match(*lineIT)) {
- std::vectorblocxx::String ia = convStringArray(issuerRegex.capture(*lineIT));
+ std::vectorstd::string ia = issuerRegex.capture(*lineIT);
if(ia.size() == 2 ) {
issuer = ia[1];
@@ -194,21 +193,21 @@
keyID.erase();
- String serverCertIssuer;
+ std::string serverCertIssuer;
- String serverCert;
- String serverKey;
- String srvIssuerCert;
- std::vector<String> restCA;
+ std::string serverCert;
+ std::string serverKey;
+ std::string srvIssuerCert;
+ std::vectorstd::string restCA;
// search for the server certificate
- std::vector< std::map >::iterator certMap = list.begin();
+ std::vector< std::map >::iterator certMap = list.begin();
for(; certMap != list.end(); ++certMap) {
- std::map::iterator keyIT = (*certMap).find("keyID");
- std::map::iterator subjectIT = (*certMap).find("subject");
+ std::map::iterator keyIT = (*certMap).find("keyID");
+ std::map::iterator subjectIT = (*certMap).find("subject");
if( keyIT != (*certMap).end() &&
!((*keyIT).second.empty()) &&
@@ -230,7 +229,7 @@
for(; certMap != list.end(); ++certMap) {
- std::map::iterator keyIT = (*certMap).find("keyID");
+ std::map::iterator keyIT = (*certMap).find("keyID");
if( keyIT != (*certMap).end() &&
(*keyIT).second == keyID ) {
@@ -247,7 +246,7 @@
for(; certMap != list.end(); ++certMap) {
- std::map::iterator subjectIT = (*certMap).find("subject");
+ std::map::iterator subjectIT = (*certMap).find("subject");
if( subjectIT != (*certMap).end() &&
(*subjectIT).second == serverCertIssuer ) {
@@ -264,7 +263,7 @@
for(; certMap != list.end(); ++certMap) {
- std::map::iterator dataIT = (*certMap).find("data");
+ std::map::iterator dataIT = (*certMap).find("data");
if( dataIT != (*certMap).end() &&
!(*dataIT).second.empty() ) {
@@ -287,8 +286,8 @@
LOGIT_ERROR("Cannot create directory '" << pi.toString() << "' :" << errno2String(r));
BLOCXX_THROW(ca_mgm::SystemException,
- Format(__("Cannot create directory %1: %2."),
- pi.toString(), errno2String(r)).c_str());
+ str::form(__("Cannot create directory %s: %s."),
+ pi.toString().c_str(), errno2String(r).c_str()).c_str());
}
}
@@ -308,8 +307,8 @@
LOGIT_ERROR("Cannot create directory '" << pi.toString() << "' :" << errno2String(r));
BLOCXX_THROW(ca_mgm::SystemException,
- Format(__("Cannot create directory %1: %2."),
- pi.toString(), errno2String(r)).c_str());
+ str::form(__("Cannot create directory %s: %s."),
+ pi.toString().c_str(), errno2String(r).c_str()).c_str());
}
}
@@ -327,8 +326,8 @@
LOGIT_ERROR("Cannot create directory '" << pi.toString() << "' :" << errno2String(r));
BLOCXX_THROW(ca_mgm::SystemException,
- Format(__("Cannot create directory %1: %2."),
- pi.toString(), errno2String(r)).c_str());
+ str::form(__("Cannot create directory %s: %s."),
+ pi.toString().c_str(), errno2String(r).c_str()).c_str());
}
}
@@ -341,7 +340,7 @@
LOGIT_ERROR( "'" << pi.toString() <<"' is not a directory");
BLOCXX_THROW(ca_mgm::ValueException,
- Format(__("%1 is not a directory."), pi.toString()).c_str());
+ str::form(__("%s is not a directory."), pi.toString().c_str()).c_str());
}
@@ -351,7 +350,7 @@
for(uint i = 0; i < restCA.size(); ++i) {
writeFile(ByteBuffer(restCA[i].c_str(), restCA[i].length()),
- pi.toString() + "/YaST-CA-" + String(i) + ".pem");
+ pi.toString() + "/YaST-CA-" + str::numstring(i) + ".pem");
}
rehashCAs(pi.toString());
@@ -368,8 +367,8 @@
void
-LocalManagement::importCommonServerCertificate(const String &pkcs12File,
- const String &password)
+LocalManagement::importCommonServerCertificate(const std::string &pkcs12File,
+ const std::string &password)
{
importAsLocalCertificate(readFile(pkcs12File),
password,
@@ -380,7 +379,7 @@
void
LocalManagement::importCommonServerCertificate(const ByteBuffer &pkcs12Data,
- const String &password)
+ const std::string &password)
{
importAsLocalCertificate(pkcs12Data,
password,
@@ -390,21 +389,21 @@
}
CertificateData
-LocalManagement::getCertificate(const String &file,
+LocalManagement::getCertificate(const std::string &file,
FormatType type)
{
return CertificateData_Priv(file, type);
}
RequestData
-LocalManagement::getRequest(const String &file,
+LocalManagement::getRequest(const std::string &file,
FormatType type)
{
return RequestData_Priv(file, type);
}
CRLData
-LocalManagement::getCRL(const String &file,
+LocalManagement::getCRL(const std::string &file,
FormatType type)
{
return CRLData_Priv(file, type);
@@ -433,14 +432,14 @@
ByteBuffer
-LocalManagement::readFile(const String& file)
+LocalManagement::readFile(const std::string& file)
{
path::PathInfo filePi(file);
if(!filePi.exists()) {
LOGIT_ERROR("File not found: " << filePi.toString());
BLOCXX_THROW_ERR(ca_mgm::RuntimeException,
- Format(__("File not found: %1."), filePi.toString()).c_str(),
+ str::form(__("File not found: %s."), filePi.toString().c_str()).c_str(),
E_FILE_NOT_FOUND);
}
@@ -449,7 +448,7 @@
LOGIT_ERROR("File too big: " << filePi.toString());
BLOCXX_THROW(ca_mgm::RuntimeException,
- Format(__("File too big: %1."), filePi.toString()).c_str());
+ str::form(__("File too big: %s."), filePi.toString().c_str()).c_str());
}
@@ -458,7 +457,7 @@
LOGIT_ERROR("Cannot open file: " << file << "(" << errno << ")");
BLOCXX_THROW_ERRNO_MSG1(ca_mgm::SystemException,
- Format(__("Cannot open file %1."), file).c_str(),
+ str::form(__("Cannot open file %s."), file.c_str()).c_str(),
errno);
}
@@ -478,7 +477,7 @@
LOGIT_ERROR("Cannot read from file: " << file << "(" << errno << ")");
BLOCXX_THROW_ERRNO_MSG1(ca_mgm::SystemException,
- Format(__("Cannot read from file %1."), file).c_str(),
+ str::form(__("Cannot read from file %s."), file.c_str()).c_str(),
errno);
}
@@ -494,7 +493,7 @@
void
LocalManagement::writeFile(const ByteBuffer& data,
- const String &file,
+ const std::string &file,
bool overwrite,
mode_t mode)
{
@@ -503,7 +502,7 @@
LOGIT_ERROR ("File already exists: " << file );
BLOCXX_THROW_ERR(ca_mgm::SystemException,
- Format(__("File already exists: %1."), file).c_str(),
+ str::form(__("File already exists: %s."), file.c_str()).c_str(),
E_FILE_EXISTS);
}
@@ -513,7 +512,7 @@
LOGIT_ERROR("Cannot open file: " << file << "(" << errno << ")");
BLOCXX_THROW_ERRNO_MSG1(ca_mgm::SystemException,
- Format(__("Cannot open file %1."), file).c_str(),
+ str::form(__("Cannot open file %s."), file.c_str()).c_str(),
errno);
}
@@ -525,7 +524,7 @@
LOGIT_ERROR("Cannot get lock on file: " << file << "(" << errno << ")");
BLOCXX_THROW_ERRNO_MSG1(ca_mgm::SystemException,
- Format(__("Cannot get lock on file %1."), file).c_str(),
+ str::form(__("Cannot get lock on file %s."), file.c_str()).c_str(),
errno);
}
@@ -539,7 +538,7 @@
LOGIT_ERROR("Cannot write to file: " << file << "(" << errno << ")");
BLOCXX_THROW_ERRNO_MSG1(ca_mgm::SystemException,
- Format(__("Cannot write to file %1."), file).c_str(),
+ str::form(__("Cannot write to file %s."), file.c_str()).c_str(),
errno);
}
@@ -559,9 +558,9 @@
LocalManagement::rsaConvert(const ByteBuffer &key,
FormatType inform,
FormatType outform,
- const String &inPassword,
- const String &outPassword,
- const String &algorithm)
+ const std::string &inPassword,
+ const std::string &outPassword,
+ const std::string &algorithm)
{
return OpenSSLUtils::rsaConvert(key, inform, outform,
inPassword, outPassword, algorithm);
@@ -586,10 +585,10 @@
ByteBuffer
LocalManagement::createPKCS12(const ByteBuffer &certificate,
const ByteBuffer &key,
- const String &inPassword,
- const String &outPassword,
+ const std::string &inPassword,
+ const std::string &outPassword,
const ByteBuffer &caCert,
- const String &caPath,
+ const std::string &caPath,
bool withChain )
{
return OpenSSLUtils::createPKCS12(certificate, key, inPassword,
@@ -598,9 +597,9 @@
ByteBuffer
LocalManagement::pkcs12ToPEM(const ByteBuffer &pkcs12,
- const String &inPassword,
- const String &outPassword,
- const String &algorithm)
+ const std::string &inPassword,
+ const std::string &outPassword,
+ const std::string &algorithm)
{
return OpenSSLUtils::pkcs12ToPEM(pkcs12, inPassword,
outPassword, algorithm);
Modified: limal-branches/mc-devel/limal-ca-mgm/src/Makefile.am
URL: http://svn.opensuse.org/viewcvs/limal/limal-branches/mc-devel/limal-ca-mgm/src/Makefile.am?rev=2675&r1=2674&r2=2675&view=diff
==============================================================================
--- limal-branches/mc-devel/limal-ca-mgm/src/Makefile.am (original)
+++ limal-branches/mc-devel/limal-ca-mgm/src/Makefile.am Sat Jul 3 13:27:18 2010
@@ -15,6 +15,7 @@
liblimal_ca_mgm_la_SOURCES = \
Date.cpp \
PerlRegEx.cpp \
+ PosixRegEx.cpp \
String.cpp \
ValuePosixRECheck.cpp \
ValuePerlRECheck.cpp \
Modified: limal-branches/mc-devel/limal-ca-mgm/src/OpenSSLUtils.cpp
URL: http://svn.opensuse.org/viewcvs/limal/limal-branches/mc-devel/limal-ca-mgm/src/OpenSSLUtils.cpp?rev=2675&r1=2674&r2=2675&view=diff
==============================================================================
--- limal-branches/mc-devel/limal-ca-mgm/src/OpenSSLUtils.cpp (original)
+++ limal-branches/mc-devel/limal-ca-mgm/src/OpenSSLUtils.cpp Sat Jul 3 13:27:18 2010
@@ -40,9 +40,9 @@
using namespace blocxx;
-OpenSSLUtils::OpenSSLUtils(const String &configFile,
- const String &command,
- const String &tmpDir)
+OpenSSLUtils::OpenSSLUtils(const std::string &configFile,
+ const std::string &command,
+ const std::string &tmpDir)
: m_cmd(command), m_tmp(tmpDir), m_conf(configFile)
{
path::PathInfo pi(configFile);
@@ -51,7 +51,7 @@
{
LOGIT_ERROR("File does not exist: " << configFile);
BLOCXX_THROW_ERR(ca_mgm::ValueException,
- Format(__("File does not exist: %1."), configFile).c_str(),
+ str::form(__("File does not exist: %s."), configFile.c_str()).c_str(),
E_FILE_NOT_FOUND);
}
@@ -60,7 +60,7 @@
{
LOGIT_ERROR("Directory does not exist: " << tmpDir);
BLOCXX_THROW_ERR(ca_mgm::ValueException,
- Format(__("Directory does not exist: %1."), tmpDir).c_str(),
+ str::form(__("Directory does not exist: %s."), tmpDir.c_str()).c_str(),
E_FILE_NOT_FOUND);
}
@@ -69,7 +69,7 @@
{
LOGIT_ERROR("Invalid command: " << command);
BLOCXX_THROW(ca_mgm::ValueException,
- Format(__("Invalid command %1."), command).c_str());
+ str::form(__("Invalid command %s."), command.c_str()).c_str());
}
path::PathName r = path::PathName::dirName(configFile);
@@ -84,12 +84,12 @@
}
void
-OpenSSLUtils::createRSAKey(const String &outFile,
- const String &password,
+OpenSSLUtils::createRSAKey(const std::string &outFile,
+ const std::string &password,
uint32_t bits,
- const String &cryptAlgorithm)
+ const std::string &cryptAlgorithm)
{
- blocxx::String debugCmd;
+ std::string debugCmd;
debugCmd += m_cmd + " ";
debugCmd += "genrsa ";
@@ -102,20 +102,20 @@
debugCmd += "-" + cryptAlgorithm + " ";
}
- debugCmd += String(bits);
+ debugCmd += str::numstring(bits);
- std::vectorblocxx::String cmd = convStringArray(PerlRegEx("\\s").split(debugCmd));
+ std::vectorstd::string cmd = PerlRegEx("\\s").split(debugCmd);
LOGIT_DEBUG("Command: " << debugCmd);
blocxx::EnvVars env;
env.addVar("PATH", "/usr/bin/");
- env.addVar("RANDFILE", m_rand);
+ env.addVar("RANDFILE", m_rand.c_str());
- env.addVar("pass", password);
+ env.addVar("pass", password.c_str());
- blocxx::String stdOutput;
- blocxx::String errOutput;
+ std::string stdOutput;
+ std::string errOutput;
int status = -1;
try
@@ -131,14 +131,15 @@
}
if(status != 0)
{
- LOGIT_ERROR("openssl status:" << blocxx::String(status));
+ LOGIT_ERROR("openssl status:" << str::numstring(status));
LOGIT_ERROR("openssl stderr:" << errOutput);
LOGIT_DEBUG("openssl stdout:" << stdOutput);
- std::vectorblocxx::String sa = convStringArray(errOutput.tokenize("\n\r"));
- String msg = (sa.empty()? "" : sa[0]);
+ std::vectorstd::string sa;
+ str::split(errOutput, std::back_inserter(sa), "\n\r");
+ std::string msg = (sa.empty()? "" : sa[0]);
BLOCXX_THROW(ca_mgm::RuntimeException,
- Format(__("openssl command failed: %1"), msg).c_str());
+ str::form(__("openssl command failed: %s"), msg.c_str()).c_str());
}
if(!errOutput.empty())
@@ -153,15 +154,15 @@
void
OpenSSLUtils::createRequest(const DNObject &dn,
- const String &outFile,
- const String &keyFile,
- const String &password,
- const String &extension,
+ const std::string &outFile,
+ const std::string &keyFile,
+ const std::string &password,
+ const std::string &extension,
FormatType outForm,
- const String &challengePassword,
- const String &unstructuredName)
+ const std::string &challengePassword,
+ const std::string &unstructuredName)
{
- blocxx::String debugCmd;
+ std::string debugCmd;
debugCmd += m_cmd + " ";
debugCmd += "req -new ";
@@ -197,19 +198,19 @@
debugCmd += "-passin env:pass ";
- std::vectorblocxx::String cmd = convStringArray(PerlRegEx("\\s").split(debugCmd));
+ std::vectorstd::string cmd = PerlRegEx("\\s").split(debugCmd);
LOGIT_DEBUG("Command: " << debugCmd);
blocxx::EnvVars env;
env.addVar("PATH", "/usr/bin/");
- env.addVar("RANDFILE", m_rand);
+ env.addVar("RANDFILE", m_rand.c_str());
- env.addVar("pass", password);
+ env.addVar("pass", password.c_str());
- blocxx::String stdInput;
- blocxx::String stdOutput;
- blocxx::String errOutput;
+ std::string stdInput;
+ std::string stdOutput;
+ std::string errOutput;
int status = -1;
std::list<RDNObject> dnList = dn.getDN();
@@ -239,14 +240,16 @@
}
if(status != 0)
{
- LOGIT_ERROR("openssl status:" << blocxx::String(status));
+ LOGIT_ERROR("openssl status:" << str::numstring(status));
LOGIT_ERROR("openssl stderr:" << errOutput);
LOGIT_DEBUG("openssl stdout:" << stdOutput);
- std::vectorblocxx::String sa = convStringArray(errOutput.tokenize("\n\r"));
- String msg = (sa.empty()? "" : sa[0]);
+ std::vectorstd::string sa;
+ str::split(errOutput, std::back_inserter(sa), "\n\r");
+
+ std::string msg = (sa.empty()? "" : sa[0]);
BLOCXX_THROW(ca_mgm::RuntimeException,
- Format(__("openssl command failed: %1"), msg).c_str());
+ str::form(__("openssl command failed: %s"), msg.c_str()).c_str());
}
if(!errOutput.empty())
@@ -260,11 +263,11 @@
}
void
-OpenSSLUtils::createSelfSignedCertificate(const String &outFile,
- const String &keyFile,
- const String &requestFile,
- const String &password,
- const String &extension,
+OpenSSLUtils::createSelfSignedCertificate(const std::string &outFile,
+ const std::string &keyFile,
+ const std::string &requestFile,
+ const std::string &password,
+ const std::string &extension,
uint32_t days,
bool noEmailDN)
{
@@ -284,7 +287,7 @@
__("No valid request file specified."));
}
- blocxx::String debugCmd;
+ std::string debugCmd;
debugCmd += m_cmd + " ";
debugCmd += "req -x509 ";
@@ -304,24 +307,24 @@
debugCmd += "-extensions " + extension + " ";
}
- debugCmd += "-days " + String(days) + " ";
+ debugCmd += "-days " + str::numstring(days) + " ";
debugCmd += "-in " + requestFile + " ";
debugCmd += "-key " + keyFile + " ";
debugCmd += "-out " + outFile + " ";
- std::vectorblocxx::String cmd = convStringArray(PerlRegEx("\\s").split(debugCmd));
+ std::vectorstd::string cmd = PerlRegEx("\\s").split(debugCmd);
LOGIT_DEBUG("Command: " << debugCmd);
blocxx::EnvVars env;
env.addVar("PATH", "/usr/bin/");
- env.addVar("RANDFILE", m_rand);
+ env.addVar("RANDFILE", m_rand.c_str());
- env.addVar("pass", password);
+ env.addVar("pass", password.c_str());
- blocxx::String stdOutput;
- blocxx::String errOutput;
+ std::string stdOutput;
+ std::string errOutput;
int status = -1;
try
@@ -337,14 +340,16 @@
}
if(status != 0)
{
- LOGIT_ERROR("openssl status:" << blocxx::String(status));
+ LOGIT_ERROR("openssl status:" << str::numstring(status));
LOGIT_ERROR("openssl stderr:" << errOutput);
LOGIT_DEBUG("openssl stdout:" << stdOutput);
- std::vectorblocxx::String sa = convStringArray(errOutput.tokenize("\n\r"));
- String msg = (sa.empty()? "" : sa[0]);
+ std::vectorstd::string sa;
+ str::split(errOutput, std::back_inserter(sa), "\n\r");
+
+ std::string msg = (sa.empty()? "" : sa[0]);
BLOCXX_THROW(ca_mgm::RuntimeException,
- Format(__("openssl command failed: %1"), msg).c_str());
+ str::form(__("openssl command failed: %s"), msg.c_str()).c_str());
}
if(!errOutput.empty())
@@ -358,15 +363,15 @@
}
void
-OpenSSLUtils::signRequest(const String &requestFile,
- const String &outFile,
- const String &caKeyFile,
- const String &caPassword,
- const String &extension,
- const String &startDate,
- const String &endDate,
- const String &caSection,
- const String &outDir,
+OpenSSLUtils::signRequest(const std::string &requestFile,
+ const std::string &outFile,
+ const std::string &caKeyFile,
+ const std::string &caPassword,
+ const std::string &extension,
+ const std::string &startDate,
+ const std::string &endDate,
+ const std::string &caSection,
+ const std::string &outDir,
bool noEmailDN,
bool noUniqueDN,
bool noText)
@@ -387,7 +392,7 @@
__("No valid request file specified."));
}
- blocxx::String debugCmd;
+ std::string debugCmd;
debugCmd += m_cmd + " ";
debugCmd += "ca -batch ";
@@ -433,19 +438,19 @@
debugCmd += "-outdir " + outDir + " ";
}
- std::vectorblocxx::String cmd = convStringArray(PerlRegEx("\\s").split(debugCmd));
+ std::vectorstd::string cmd = PerlRegEx("\\s").split(debugCmd);
LOGIT_DEBUG("Command: " << debugCmd);
//LOGIT_DEBUG("PASSWORD: " << caPassword);
blocxx::EnvVars env;
env.addVar("PATH", "/usr/bin/");
- env.addVar("RANDFILE", m_rand);
+ env.addVar("RANDFILE", m_rand.c_str());
- env.addVar("pass", caPassword);
+ env.addVar("pass", caPassword.c_str());
- blocxx::String stdOutput;
- blocxx::String errOutput;
+ std::string stdOutput;
+ std::string errOutput;
int status = -1;
try
@@ -461,14 +466,16 @@
}
if(status != 0)
{
- LOGIT_ERROR("openssl status:" << blocxx::String(status));
+ LOGIT_ERROR("openssl status:" << str::numstring(status));
LOGIT_ERROR("openssl stderr:" << errOutput);
LOGIT_DEBUG("openssl stdout:" << stdOutput);
- std::vectorblocxx::String sa = convStringArray(errOutput.tokenize("\n\r"));
- String msg = (sa.empty()? "" : sa[0]);
+ std::vectorstd::string sa;
+ str::split(errOutput, std::back_inserter(sa), "\n\r");
+
+ std::string msg = (sa.empty()? "" : sa[0]);
BLOCXX_THROW(ca_mgm::RuntimeException,
- Format(__("openssl command failed: %1"), msg).c_str());
+ str::form(__("openssl command failed: %s"), msg.c_str()).c_str());
}
if(!errOutput.empty())
@@ -482,10 +489,10 @@
}
void
-OpenSSLUtils::revokeCertificate(const blocxx::String &caCertFile,
- const blocxx::String &caKeyFile,
- const blocxx::String &caPassword,
- const blocxx::String &certFile,
+OpenSSLUtils::revokeCertificate(const std::string &caCertFile,
+ const std::string &caKeyFile,
+ const std::string &caPassword,
+ const std::string &certFile,
const CRLReason &reason,
bool noUniqueDN)
{
@@ -513,7 +520,7 @@
__("No valid certificate file specified."));
}
- blocxx::String debugCmd;
+ std::string debugCmd;
debugCmd += m_cmd + " ";
debugCmd += "ca ";
@@ -534,15 +541,15 @@
debugCmd += "-nouniqueDN ";
}
- if(!reason.getReason().equalsIgnoreCase("none"))
+ if(0 != str::compareCI(reason.getReason(), "none"))
{
- String reasonStr = reason.getReason();
+ std::string reasonStr = reason.getReason();
- if(reasonStr.equalsIgnoreCase("certificateHold"))
+ if(0 == str::compareCI(reasonStr, "certificateHold"))
{
debugCmd += "-crl_hold " + reason.getHoldInstruction() + " ";
}
- else if(reasonStr.equalsIgnoreCase("keyCompromise"))
+ else if(0 == str::compareCI(reasonStr, "keyCompromise"))
{
if(reason.getKeyCompromiseDateAsString() == "")
{
@@ -554,7 +561,7 @@
reason.getKeyCompromiseDateAsString() + " ";
}
}
- else if(reasonStr.equalsIgnoreCase("CACompromise"))
+ else if(0 == str::compareCI(reasonStr, "CACompromise"))
{
if(reason.getCACompromiseDateAsString() == "")
{
@@ -572,18 +579,18 @@
}
}
- std::vectorblocxx::String cmd = convStringArray(PerlRegEx("\\s").split(debugCmd));
+ std::vectorstd::string cmd = PerlRegEx("\\s").split(debugCmd);
LOGIT_DEBUG("Command: " << debugCmd);
blocxx::EnvVars env;
env.addVar("PATH", "/usr/bin/");
- env.addVar("RANDFILE", m_rand);
+ env.addVar("RANDFILE", m_rand.c_str());
- env.addVar("pass", caPassword);
+ env.addVar("pass", caPassword.c_str());
- blocxx::String stdOutput;
- blocxx::String errOutput;
+ std::string stdOutput;
+ std::string errOutput;
int status = -1;
try
@@ -599,14 +606,16 @@
}
if(status != 0)
{
- LOGIT_ERROR("openssl status:" << blocxx::String(status));
+ LOGIT_ERROR("openssl status:" << str::numstring(status));
LOGIT_ERROR("openssl stderr:" << errOutput);
LOGIT_DEBUG("openssl stdout:" << stdOutput);
- std::vectorblocxx::String sa = convStringArray(errOutput.tokenize("\n\r"));
- String msg = (sa.empty()? "" : sa[0]);
+ std::vectorstd::string sa;
+ str::split(errOutput, std::back_inserter(sa), "\n\r");
+
+ std::string msg = (sa.empty()? "" : sa[0]);
BLOCXX_THROW(ca_mgm::RuntimeException,
- Format(__("openssl command failed: %1"), msg).c_str());
+ str::form(__("openssl command failed: %s"), msg.c_str()).c_str());
}
if(!errOutput.empty())
@@ -620,12 +629,12 @@
}
void
-OpenSSLUtils::issueCRL(const blocxx::String &caCertFile,
- const blocxx::String &caKeyFile,
- const blocxx::String &caPassword,
+OpenSSLUtils::issueCRL(const std::string &caCertFile,
+ const std::string &caKeyFile,
+ const std::string &caPassword,
uint32_t hours,
- const blocxx::String &outfile,
- const blocxx::String &extension,
+ const std::string &outfile,
+ const std::string &extension,
bool noUniqueDN)
{
path::PathInfo pi(caKeyFile);
@@ -644,7 +653,7 @@
__("No valid CA certificate file specified."));
}
- blocxx::String debugCmd;
+ std::string debugCmd;
debugCmd += m_cmd + " ";
debugCmd += "ca -gencrl ";
@@ -660,7 +669,7 @@
debugCmd += "-passin env:pass ";
- debugCmd += "-crlhours " + String(hours) + " ";
+ debugCmd += "-crlhours " + str::numstring(hours) + " ";
if(!extension.empty())
{
@@ -672,18 +681,18 @@
debugCmd += "-nouniqueDN ";
}
- std::vectorblocxx::String cmd = convStringArray(PerlRegEx("\\s").split(debugCmd));
+ std::vectorstd::string cmd = PerlRegEx("\\s").split(debugCmd);
LOGIT_DEBUG("Command: " << debugCmd);
blocxx::EnvVars env;
env.addVar("PATH", "/usr/bin/");
- env.addVar("RANDFILE", m_rand);
+ env.addVar("RANDFILE", m_rand.c_str());
- env.addVar("pass", caPassword);
+ env.addVar("pass", caPassword.c_str());
- blocxx::String stdOutput;
- blocxx::String errOutput;
+ std::string stdOutput;
+ std::string errOutput;
int status = -1;
try
@@ -699,14 +708,16 @@
}
if(status != 0)
{
- LOGIT_ERROR("openssl status:" << blocxx::String(status));
+ LOGIT_ERROR("openssl status:" << str::numstring(status));
LOGIT_ERROR("openssl stderr:" << errOutput);
LOGIT_DEBUG("openssl stdout:" << stdOutput);
- std::vectorblocxx::String sa = convStringArray(errOutput.tokenize("\n\r"));
- String msg = (sa.empty()? "" : sa[0]);
+ std::vectorstd::string sa;
+ str::split(errOutput, std::back_inserter(sa), "\n\r");
+
+ std::string msg = (sa.empty()? "" : sa[0]);
BLOCXX_THROW(ca_mgm::RuntimeException,
- Format(__("openssl command failed: %1"), msg).c_str());
+ str::form(__("openssl command failed: %s"), msg.c_str()).c_str());
}
if(!errOutput.empty())
@@ -720,9 +731,9 @@
}
void
-OpenSSLUtils::updateDB(const blocxx::String &caCertFile,
- const blocxx::String &caKeyFile,
- const blocxx::String &caPassword)
+OpenSSLUtils::updateDB(const std::string &caCertFile,
+ const std::string &caKeyFile,
+ const std::string &caPassword)
{
path::PathInfo pi(caKeyFile);
if(!pi.exists() || !pi.isFile())
@@ -740,7 +751,7 @@
__("No valid CA certificate file specified."));
}
- blocxx::String debugCmd;
+ std::string debugCmd;
debugCmd += m_cmd + " ";
debugCmd += "ca -updatedb ";
@@ -754,18 +765,18 @@
debugCmd += "-passin env:pass ";
- std::vectorblocxx::String cmd = convStringArray(PerlRegEx("\\s").split(debugCmd));
+ std::vectorstd::string cmd = PerlRegEx("\\s").split(debugCmd);
LOGIT_DEBUG("Command: " << debugCmd);
blocxx::EnvVars env;
env.addVar("PATH", "/usr/bin/");
- env.addVar("RANDFILE", m_rand);
+ env.addVar("RANDFILE", m_rand.c_str());
- env.addVar("pass", caPassword);
+ env.addVar("pass", caPassword.c_str());
- blocxx::String stdOutput;
- blocxx::String errOutput;
+ std::string stdOutput;
+ std::string errOutput;
int status = -1;
try
@@ -784,14 +795,16 @@
if( (status != 0 && status != 256) || r.match(errOutput) )
{
- LOGIT_ERROR("openssl status:" << blocxx::String(status));
+ LOGIT_ERROR("openssl status:" << str::numstring(status));
LOGIT_ERROR("openssl stderr:" << errOutput);
LOGIT_DEBUG("openssl stdout:" << stdOutput);
- std::vectorblocxx::String sa = convStringArray(errOutput.tokenize("\n\r"));
- String msg = (sa.empty()? "" : sa[0]);
+ std::vectorstd::string sa;
+ str::split(errOutput, std::back_inserter(sa), "\n\r");
+
+ std::string msg = (sa.empty()? "" : sa[0]);
BLOCXX_THROW(ca_mgm::RuntimeException,
- Format(__("openssl command failed: %1"), msg).c_str());
+ str::form(__("openssl command failed: %s"), msg.c_str()).c_str());
}
if(!errOutput.empty())
@@ -804,11 +817,11 @@
}
}
-blocxx::String
-OpenSSLUtils::verify(const blocxx::String &certFile,
- const blocxx::String &caPath,
+std::string
+OpenSSLUtils::verify(const std::string &certFile,
+ const std::string &caPath,
bool crlCheck,
- const blocxx::String &purpose)
+ const std::string &purpose)
{
path::PathInfo pi(certFile);
if(!pi.exists() || !pi.isFile())
@@ -826,7 +839,7 @@
__("No valid CA directory specified."));
}
- blocxx::String debugCmd;
+ std::string debugCmd;
debugCmd += m_cmd + " ";
debugCmd += "verify ";
@@ -845,16 +858,16 @@
debugCmd += certFile;
- std::vectorblocxx::String cmd = convStringArray(PerlRegEx("\\s").split(debugCmd));
+ std::vectorstd::string cmd = PerlRegEx("\\s").split(debugCmd);
LOGIT_DEBUG("Command: " << debugCmd);
blocxx::EnvVars env;
env.addVar("PATH", "/usr/bin/");
- env.addVar("RANDFILE", m_rand);
+ env.addVar("RANDFILE", m_rand.c_str());
- blocxx::String stdOutput;
- blocxx::String errOutput;
+ std::string stdOutput;
+ std::string errOutput;
int status = -1;
try
@@ -869,18 +882,18 @@
__("Executing openssl command failed."), e);
}
- std::vectorblocxx::String lines = convStringArray(PerlRegEx("\n").split(stdOutput));
- std::vectorblocxx::String::const_iterator line;
+ std::vectorstd::string lines = PerlRegEx("\n").split(stdOutput);
+ std::vectorstd::string::const_iterator line;
- String result;
- String errMsg;
- String errNum;
+ std::string result;
+ std::string errMsg;
+ std::string errNum;
PerlRegEx ok("\\.pem:\\s+(.*)\\s*$");
PerlRegEx error("^error\\s+(\\d+)\\s+at\\s+\\d+\\s+[\\w\\s]+:(.*)$");
for(line = lines.begin(); line != lines.end(); ++line)
{
- std::vectorblocxx::String sa = convStringArray(ok.capture(*line));
+ std::vectorstd::string sa = ok.capture(*line);
if(sa.size() == 2 && sa[1] == "OK")
{
@@ -888,7 +901,7 @@
break;
}
- sa = convStringArray(error.capture(*line));
+ sa = error.capture(*line);
if(sa.size() == 3)
{
@@ -902,11 +915,11 @@
{
if(!errOutput.empty())
{
- LOGIT_INFO(Format("Certificate invalid! (%1 / %2)", result, errMsg).toString());
+ LOGIT_INFO(str::form("Certificate invalid! (%s / %s)", result.c_str(), errMsg.c_str()));
LOGIT_ERROR("openssl stderr:" << errOutput);
}
- return Format("Certificate invalid! (%1 / %2)", result, errMsg).toString();
+ return str::form("Certificate invalid! (%s / %s)", result.c_str(), errMsg.c_str());
}
else
{
@@ -914,10 +927,10 @@
}
}
-blocxx::String
-OpenSSLUtils::status(const blocxx::String &serial)
+std::string
+OpenSSLUtils::status(const std::string &serial)
{
- blocxx::String debugCmd;
+ std::string debugCmd;
debugCmd += m_cmd + " ";
debugCmd += "ca ";
@@ -926,16 +939,16 @@
debugCmd += "-status " + serial;
- std::vectorblocxx::String cmd = convStringArray(PerlRegEx("\\s").split(debugCmd));
+ std::vectorstd::string cmd = PerlRegEx("\\s").split(debugCmd);
LOGIT_DEBUG("Command: " << debugCmd);
blocxx::EnvVars env;
env.addVar("PATH", "/usr/bin/");
- env.addVar("RANDFILE", m_rand);
+ env.addVar("RANDFILE", m_rand.c_str());
- blocxx::String stdOutput;
- blocxx::String errOutput;
+ std::string stdOutput;
+ std::string errOutput;
int status = -1;
try
@@ -950,16 +963,16 @@
__("Executing openssl command failed."), e);
}
- std::vectorblocxx::String lines = convStringArray(PerlRegEx("\n").split(errOutput));
- std::vectorblocxx::String::const_iterator line;
+ std::vectorstd::string lines = PerlRegEx("\n").split(errOutput);
+ std::vectorstd::string::const_iterator line;
- String errMsg;
+ std::string errMsg;
PerlRegEx serialMatch(serial + "=(\\w+)\\s+.*$");
for(line = lines.begin(); line != lines.end(); ++line)
{
- std::vectorblocxx::String sa = convStringArray(serialMatch.capture(*line));
+ std::vectorstd::string sa = serialMatch.capture(*line);
if(sa.size() == 2)
{
@@ -970,24 +983,24 @@
errMsg += *line + "\n";
}
}
- LOGIT_ERROR(Format("Show certificate status with serial '%1' failed.(%2)",
- serial, status).toString());
+ LOGIT_ERROR(str::form("Show certificate status with serial '%s' failed.(%d)",
+ serial.c_str(), status));
if(!errOutput.empty())
{
LOGIT_ERROR("openssl stderr:" << errOutput);
}
BLOCXX_THROW(ca_mgm::RuntimeException,
- Format(__("Showing certificate status with serial %1 failed (%2)."),
- serial, status).c_str());
+ str::form(__("Showing certificate status with serial %s failed (%d)."),
+ serial.c_str(), status).c_str());
}
bool
-OpenSSLUtils::checkKey(const blocxx::String &caName,
- const blocxx::String &password,
- const blocxx::String &certificateName,
- const blocxx::String &repository)
+OpenSSLUtils::checkKey(const std::string &caName,
+ const std::string &password,
+ const std::string &certificateName,
+ const std::string &repository)
{
- String keyFile;
+ std::string keyFile;
if(certificateName == "cacert")
{
@@ -996,7 +1009,7 @@
else
{
PerlRegEx r("^[[:xdigit:]]+:([[:xdigit:]]+[\\d-]*)$");
- std::vectorblocxx::String sa = convStringArray(r.capture(certificateName));
+ std::vectorstd::string sa = r.capture(certificateName);
if(sa.size() != 2)
{
@@ -1016,25 +1029,25 @@
__("The key file does not exist."));
}
- blocxx::String debugCmd;
+ std::string debugCmd;
debugCmd += ca_mgm::OPENSSL_COMMAND + " ";
debugCmd += "rsa -noout -in ";
debugCmd += keyFile + " ";
debugCmd += "-passin env:PASSWORD ";
- std::vectorblocxx::String cmd = convStringArray(PerlRegEx("\\s").split(debugCmd));
+ std::vectorstd::string cmd = PerlRegEx("\\s").split(debugCmd);
LOGIT_DEBUG("Command: " << debugCmd);
blocxx::EnvVars env;
env.addVar("PATH", "/usr/bin/");
- env.addVar("RANDFILE", m_rand);
+ env.addVar("RANDFILE", m_rand.c_str());
- env.addVar("PASSWORD", password);
+ env.addVar("PASSWORD", password.c_str());
- blocxx::String stdOutput;
- blocxx::String errOutput;
+ std::string stdOutput;
+ std::string errOutput;
int status = -1;
try
@@ -1069,13 +1082,13 @@
FormatType outform )
{
// FIXME: use tmp file
- blocxx::String inFileName(::tempnam("/tmp/", "x509I"));
- blocxx::String outFileName(::tempnam("/tmp/", "x509O"));
+ std::string inFileName(::tempnam("/tmp/", "x509I"));
+ std::string outFileName(::tempnam("/tmp/", "x509O"));
LocalManagement::writeFile(certificate, inFileName,
false, 0600);
- blocxx::String debugCmd;
+ std::string debugCmd;
bool foundError = false;
debugCmd += ca_mgm::OPENSSL_COMMAND + " ";
@@ -1110,16 +1123,16 @@
break;
}
- std::vectorblocxx::String cmd = convStringArray(PerlRegEx("\\s").split(debugCmd));
+ std::vectorstd::string cmd = PerlRegEx("\\s").split(debugCmd);
LOGIT_DEBUG("Command: " << debugCmd);
- blocxx::String randfile(::tempnam("/tmp/", ".rand-"));
+ std::string randfile(::tempnam("/tmp/", ".rand-"));
blocxx::EnvVars env;
env.addVar("PATH", "/usr/bin/");
- env.addVar("RANDFILE", randfile);
- blocxx::String stdOutput;
- blocxx::String errOutput;
+ env.addVar("RANDFILE", randfile.c_str());
+ std::string stdOutput;
+ std::string errOutput;
int status = -1;
try
@@ -1138,7 +1151,7 @@
}
if(status != 0)
{
- LOGIT_INFO( "openssl status:" << blocxx::String(status));
+ LOGIT_INFO( "openssl status:" << str::numstring(status));
foundError = true;
}
if(!errOutput.empty())
@@ -1157,10 +1170,12 @@
path::removeFile(outFileName);
path::removeFile(randfile);
- std::vectorblocxx::String sa = convStringArray(errOutput.tokenize("\n\r"));
- String msg = (sa.empty()? "" : sa[0]);
+ std::vectorstd::string sa;
+ str::split(errOutput, std::back_inserter(sa), "\n\r");
+
+ std::string msg = (sa.empty()? "" : sa[0]);
BLOCXX_THROW(ca_mgm::RuntimeException,
- Format(__("openssl command failed: %1"), msg).c_str());
+ str::form(__("openssl command failed: %s"), msg.c_str()).c_str());
}
ByteBuffer out = LocalManagement::readFile(outFileName);
@@ -1176,13 +1191,13 @@
OpenSSLUtils::rsaConvert(const ByteBuffer &key,
FormatType inform,
FormatType outform,
- const String &inPassword,
- const String &outPassword,
- const String &algorithm)
+ const std::string &inPassword,
+ const std::string &outPassword,
+ const std::string &algorithm)
{
// FIXME: use tmp file
- blocxx::String inFileName(::tempnam("/tmp/", "keyIn"));
- blocxx::String outFileName(::tempnam("/tmp/", "keyOt"));
+ std::string inFileName(::tempnam("/tmp/", "keyIn"));
+ std::string outFileName(::tempnam("/tmp/", "keyOt"));
bool isInPassSet = false;
bool isOutPassSet = false;
@@ -1191,7 +1206,7 @@
LocalManagement::writeFile(key, inFileName,
false, 0600);
- blocxx::String debugCmd;
+ std::string debugCmd;
debugCmd += ca_mgm::OPENSSL_COMMAND + " ";
debugCmd += "rsa ";
@@ -1237,27 +1252,27 @@
isOutPassSet = true;
}
- std::vectorblocxx::String cmd = convStringArray(PerlRegEx("\\s").split(debugCmd));
+ std::vectorstd::string cmd = PerlRegEx("\\s").split(debugCmd);
LOGIT_DEBUG("Command: " << debugCmd);
- blocxx::String randfile(::tempnam("/tmp/", ".rand-"));
+ std::string randfile(::tempnam("/tmp/", ".rand-"));
blocxx::EnvVars env;
env.addVar("PATH", "/usr/bin/");
- env.addVar("RANDFILE", randfile);
+ env.addVar("RANDFILE", randfile.c_str());
if(isInPassSet)
{
- env.addVar("inpass", inPassword);
+ env.addVar("inpass", inPassword.c_str());
}
if(isOutPassSet)
{
- env.addVar("outpass", outPassword);
+ env.addVar("outpass", outPassword.c_str());
}
- blocxx::String stdOutput;
- blocxx::String errOutput;
+ std::string stdOutput;
+ std::string errOutput;
int status = -1;
try
@@ -1276,7 +1291,7 @@
}
if(status != 0)
{
- LOGIT_INFO( "openssl status:" << blocxx::String(status));
+ LOGIT_INFO( "openssl status:" << str::numstring(status));
foundError = true;
}
if(!errOutput.empty())
@@ -1303,8 +1318,10 @@
path::removeFile(outFileName);
path::removeFile(randfile);
- std::vectorblocxx::String sa = convStringArray(errOutput.tokenize("\n\r"));
- String msg = (sa.empty()? "" : sa[0]);
+ std::vectorstd::string sa;
+ str::split(errOutput, std::back_inserter(sa), "\n\r");
+
+ std::string msg = (sa.empty()? "" : sa[0]);
if(PerlRegEx("unable to load Private Key", PCRE_CASELESS).match(msg))
{
BLOCXX_THROW_ERR(ca_mgm::ValueException,
@@ -1313,7 +1330,7 @@
else
{
BLOCXX_THROW(ca_mgm::RuntimeException,
- Format(__("openssl command failed: %1"),msg).c_str());
+ str::form(__("openssl command failed: %s"),msg.c_str()).c_str());
}
}
@@ -1332,13 +1349,13 @@
FormatType outform )
{
// FIXME: use tmp file
- blocxx::String inFileName(::tempnam("/tmp/", "crlIn"));
- blocxx::String outFileName(::tempnam("/tmp/", "crlOt"));
+ std::string inFileName(::tempnam("/tmp/", "crlIn"));
+ std::string outFileName(::tempnam("/tmp/", "crlOt"));
LocalManagement::writeFile(crl, inFileName,
false, 0600);
- blocxx::String debugCmd;
+ std::string debugCmd;
bool foundError = false;
debugCmd += ca_mgm::OPENSSL_COMMAND + " ";
@@ -1371,16 +1388,16 @@
break;
}
- std::vectorblocxx::String cmd = convStringArray(PerlRegEx("\\s").split(debugCmd));
+ std::vectorstd::string cmd = PerlRegEx("\\s").split(debugCmd);
LOGIT_DEBUG("Command: " << debugCmd);
- blocxx::String randfile(::tempnam("/tmp/", ".rand-"));
+ std::string randfile(::tempnam("/tmp/", ".rand-"));
blocxx::EnvVars env;
env.addVar("PATH", "/usr/bin/");
- env.addVar("RANDFILE", randfile);
- blocxx::String stdOutput;
- blocxx::String errOutput;
+ env.addVar("RANDFILE", randfile.c_str());
+ std::string stdOutput;
+ std::string errOutput;
int status = -1;
try
@@ -1399,7 +1416,7 @@
}
if(status != 0)
{
- LOGIT_INFO( "openssl status:" << blocxx::String(status));
+ LOGIT_INFO( "openssl status:" << str::numstring(status));
foundError = true;
}
if(!errOutput.empty())
@@ -1418,10 +1435,12 @@
path::removeFile(outFileName);
path::removeFile(randfile);
- std::vectorblocxx::String sa = convStringArray(errOutput.tokenize("\n\r"));
- String msg = (sa.empty()? "" : sa[0]);
+ std::vectorstd::string sa;
+ str::split(errOutput, std::back_inserter(sa), "\n\r");
+
+ std::string msg = (sa.empty()? "" : sa[0]);
BLOCXX_THROW(ca_mgm::RuntimeException,
- Format(__("openssl command failed: %1"), msg).c_str());
+ str::form(__("openssl command failed: %s"), msg.c_str()).c_str());
}
ByteBuffer out = LocalManagement::readFile(outFileName);
@@ -1439,13 +1458,13 @@
FormatType outform )
{
// FIXME: use tmp file
- blocxx::String inFileName(::tempnam("/tmp/", "reqIn"));
- blocxx::String outFileName(::tempnam("/tmp/", "reqOt"));
+ std::string inFileName(::tempnam("/tmp/", "reqIn"));
+ std::string outFileName(::tempnam("/tmp/", "reqOt"));
LocalManagement::writeFile(req, inFileName,
false, 0600);
- blocxx::String debugCmd;
+ std::string debugCmd;
bool foundError = false;
debugCmd += ca_mgm::OPENSSL_COMMAND + " ";
@@ -1478,16 +1497,16 @@
break;
}
- std::vectorblocxx::String cmd = convStringArray(PerlRegEx("\\s").split(debugCmd));
+ std::vectorstd::string cmd = PerlRegEx("\\s").split(debugCmd);
LOGIT_DEBUG("Command: " << debugCmd);
- blocxx::String randfile(::tempnam("/tmp/", ".rand-"));
+ std::string randfile(::tempnam("/tmp/", ".rand-"));
blocxx::EnvVars env;
env.addVar("PATH", "/usr/bin/");
- env.addVar("RANDFILE", randfile);
- blocxx::String stdOutput;
- blocxx::String errOutput;
+ env.addVar("RANDFILE", randfile.c_str());
+ std::string stdOutput;
+ std::string errOutput;
int status = -1;
try
@@ -1506,7 +1525,7 @@
}
if(status != 0)
{
- LOGIT_INFO( "openssl status:" << blocxx::String(status));
+ LOGIT_INFO( "openssl status:" << str::numstring(status));
foundError = true;
}
if(!errOutput.empty())
@@ -1525,10 +1544,12 @@
path::removeFile(outFileName);
path::removeFile(randfile);
- std::vectorblocxx::String sa = convStringArray(errOutput.tokenize("\n\r"));
- String msg = (sa.empty()? "" : sa[0]);
+ std::vectorstd::string sa;
+ str::split(errOutput, std::back_inserter(sa), "\n\r");
+
+ std::string msg = (sa.empty()? "" : sa[0]);
BLOCXX_THROW(ca_mgm::RuntimeException,
- Format(__("openssl command failed: %1"), msg).c_str());
+ str::form(__("openssl command failed: %s"), msg.c_str()).c_str());
}
ByteBuffer out = LocalManagement::readFile(outFileName);
@@ -1543,17 +1564,17 @@
ca_mgm::ByteBuffer
OpenSSLUtils::createPKCS12(const ByteBuffer &certificate,
const ByteBuffer &key,
- const String &inPassword,
- const String &outPassword,
+ const std::string &inPassword,
+ const std::string &outPassword,
const ByteBuffer &caCert,
- const String &caPath,
+ const std::string &caPath,
bool withChain )
{
// FIXME: use tmp file
- blocxx::String inFileName1(::tempnam("/tmp/", "crtIn"));
- blocxx::String inFileName2(::tempnam("/tmp/", "keyIn"));
- blocxx::String inFileName3(::tempnam("/tmp/", "caIn"));
- blocxx::String outFileName(::tempnam("/tmp/", "p12Ot"));
+ std::string inFileName1(::tempnam("/tmp/", "crtIn"));
+ std::string inFileName2(::tempnam("/tmp/", "keyIn"));
+ std::string inFileName3(::tempnam("/tmp/", "caIn"));
+ std::string outFileName(::tempnam("/tmp/", "p12Ot"));
bool isInPassSet = false;
bool isOutPassSet = false;
@@ -1569,7 +1590,7 @@
false, 0600);
}
- blocxx::String debugCmd;
+ std::string debugCmd;
debugCmd += ca_mgm::OPENSSL_COMMAND + " ";
debugCmd += "pkcs12 ";
@@ -1618,27 +1639,27 @@
debugCmd += inFileName3 + " ";
}
- std::vectorblocxx::String cmd = convStringArray(PerlRegEx("\\s").split(debugCmd));
+ std::vectorstd::string cmd = PerlRegEx("\\s").split(debugCmd);
LOGIT_DEBUG("Command: " << debugCmd);
- blocxx::String randfile(::tempnam("/tmp/", ".rand-"));
+ std::string randfile(::tempnam("/tmp/", ".rand-"));
blocxx::EnvVars env;
env.addVar("PATH", "/usr/bin/");
- env.addVar("RANDFILE", randfile);
+ env.addVar("RANDFILE", randfile.c_str());
if(isInPassSet)
{
- env.addVar("inpass", inPassword);
+ env.addVar("inpass", inPassword.c_str());
}
if(isOutPassSet)
{
- env.addVar("outpass", outPassword);
+ env.addVar("outpass", outPassword.c_str());
}
- blocxx::String stdOutput;
- blocxx::String errOutput;
+ std::string stdOutput;
+ std::string errOutput;
int status = -1;
try
@@ -1662,7 +1683,7 @@
}
if(status != 0)
{
- LOGIT_INFO( "openssl status:" << blocxx::String(status));
+ LOGIT_INFO( "openssl status:" << str::numstring(status));
foundError = true;
}
if(!errOutput.empty())
@@ -1686,8 +1707,10 @@
path::removeFile(outFileName);
path::removeFile(randfile);
- std::vectorblocxx::String sa = convStringArray(errOutput.tokenize("\n\r"));
- String msg = (sa.empty()? "" : sa[0]);
+ std::vectorstd::string sa;
+ str::split(errOutput, std::back_inserter(sa), "\n\r");
+
+ std::string msg = (sa.empty()? "" : sa[0]);
if(PerlRegEx("unable to load Private Key", PCRE_CASELESS).match(msg))
{
BLOCXX_THROW_ERR(ca_mgm::ValueException,
@@ -1696,7 +1719,7 @@
else
{
BLOCXX_THROW(ca_mgm::RuntimeException,
- Format(__("openssl command failed: %1"), msg).c_str());
+ str::form(__("openssl command failed: %s"), msg.c_str()).c_str());
}
}
@@ -1716,13 +1739,13 @@
ca_mgm::ByteBuffer
OpenSSLUtils::pkcs12ToPEM(const ByteBuffer &pkcs12,
- const String &inPassword,
- const String &outPassword,
- const String &algorithm)
+ const std::string &inPassword,
+ const std::string &outPassword,
+ const std::string &algorithm)
{
// FIXME: use tmp file
- blocxx::String inFileName(::tempnam("/tmp/", "p12In"));
- blocxx::String outFileName(::tempnam("/tmp/", "x509O"));
+ std::string inFileName(::tempnam("/tmp/", "p12In"));
+ std::string outFileName(::tempnam("/tmp/", "x509O"));
bool isInPassSet = false;
bool isOutPassSet = false;
@@ -1731,7 +1754,7 @@
LocalManagement::writeFile(pkcs12, inFileName,
false, 0600);
- blocxx::String debugCmd;
+ std::string debugCmd;
debugCmd += ca_mgm::OPENSSL_COMMAND + " ";
debugCmd += "pkcs12 ";
@@ -1765,27 +1788,27 @@
debugCmd += "-nodes ";
}
- std::vectorblocxx::String cmd = convStringArray(PerlRegEx("\\s").split(debugCmd));
+ std::vectorstd::string cmd = PerlRegEx("\\s").split(debugCmd);
LOGIT_DEBUG("Command: " << debugCmd);
- blocxx::String randfile(::tempnam("/tmp/", ".rand-"));
+ std::string randfile(::tempnam("/tmp/", ".rand-"));
blocxx::EnvVars env;
env.addVar("PATH", "/usr/bin/");
- env.addVar("RANDFILE", randfile);
+ env.addVar("RANDFILE", randfile.c_str());
if(isInPassSet)
{
- env.addVar("inpass", inPassword);
+ env.addVar("inpass", inPassword.c_str());
}
if(isOutPassSet)
{
- env.addVar("outpass", outPassword);
+ env.addVar("outpass", outPassword.c_str());
}
- blocxx::String stdOutput;
- blocxx::String errOutput;
+ std::string stdOutput;
+ std::string errOutput;
int status = -1;
try
@@ -1804,7 +1827,7 @@
}
if(status != 0)
{
- LOGIT_INFO( "openssl status:" << blocxx::String(status));
+ LOGIT_INFO( "openssl status:" << str::numstring(status));
foundError = true;
}
if(!errOutput.empty())
@@ -1831,8 +1854,10 @@
path::removeFile(outFileName);
path::removeFile(randfile);
- std::vectorblocxx::String sa = convStringArray(errOutput.tokenize("\n\r"));
- String msg = (sa.empty()? "" : sa[0]);
+ std::vectorstd::string sa;
+ str::split(errOutput, std::back_inserter(sa), "\n\r");
+
+ std::string msg = (sa.empty()? "" : sa[0]);
if(PerlRegEx("invalid password", PCRE_CASELESS).match(msg))
{
BLOCXX_THROW_ERR(ca_mgm::ValueException,
@@ -1841,7 +1866,7 @@
else
{
BLOCXX_THROW(ca_mgm::RuntimeException,
- Format(__("openssl command failed: %1"), msg).c_str());
+ str::form(__("openssl command failed: %s"), msg.c_str()).c_str());
}
}
@@ -1854,11 +1879,11 @@
return out;
}
-std::vectorblocxx::String
-OpenSSLUtils::listCA(const String &repository)
+std::vectorstd::string
+OpenSSLUtils::listCA(const std::string &repository)
{
- std::list<String> tmpList;
- std::vector<String> retList;
+ std::liststd::string tmpList;
+ std::vectorstd::string retList;
int r = path::readDir(tmpList, repository, false);
@@ -1867,13 +1892,13 @@
LOGIT_ERROR("Cannot read directory: " << repository <<
"(" << System::errorMsg(r) << ") [" << r << "]");
BLOCXX_THROW(ca_mgm::SystemException,
- Format(__("Cannot read directory: %1 (%2) [%3]."),
- repository, System::errorMsg(r), r).c_str());
+ str::form(__("Cannot read directory: %s (%s) [%d]."),
+ repository.c_str(), ::strerror(r), r).c_str());
}
tmpList.sort();
- std::list<String>::const_iterator cont;
+ std::liststd::string::const_iterator cont;
path::PathInfo pi(repository);
@@ -1899,15 +1924,15 @@
return retList;
}
-blocxx::String
-OpenSSLUtils::nextSerial(const String &serialFile)
+std::string
+OpenSSLUtils::nextSerial(const std::string &serialFile)
{
ByteBuffer b = LocalManagement::readFile(serialFile);
- String s(b.data(), b.size());
+ std::string s(b.data(), b.size());
PerlRegEx r("^([[:xdigit:]]+)$");
- std::vectorblocxx::String sa = convStringArray(r.capture(s));
+ std::vectorstd::string sa = r.capture(s);
if(sa.size() == 2)
{
@@ -1917,19 +1942,19 @@
{
LOGIT_ERROR("No serial number found in " << serialFile);
BLOCXX_THROW(ca_mgm::RuntimeException,
- Format(__("No serial number found in %1."),
- serialFile).c_str());
+ str::form(__("No serial number found in %s."),
+ serialFile.c_str()).c_str());
}
}
void
-OpenSSLUtils::addCAM(const String &caName,
- const String &md5,
- const String &dnString,
- const String &repository)
+OpenSSLUtils::addCAM(const std::string &caName,
+ const std::string &md5,
+ const std::string &dnString,
+ const std::string &repository)
{
- std::vector db = OpenSSLUtils::parseCAMDB(caName, repository);
- std::vector::const_iterator it;
+ std::vectorstd::string > db = OpenSSLUtils::parseCAMDB(caName, repository);
+ std::vectorstd::string >::const_iterator it;
for(it = db.begin(); it != db.end(); ++it)
{
@@ -1943,7 +1968,7 @@
ByteBuffer b = LocalManagement::readFile(repository + "/" + caName + "/cam.txt");
- String cam(b.data(), b.size());
+ std::string cam(b.data(), b.size());
cam += md5 + " " + dnString + "\n";
LocalManagement::writeFile(ByteBuffer(cam.c_str(), cam.length()),
@@ -1952,18 +1977,18 @@
}
void
-OpenSSLUtils::delCAM(const String &caName,
- const String &md5,
- const String &repository)
+OpenSSLUtils::delCAM(const std::string &caName,
+ const std::string &md5,
+ const std::string &repository)
{
ByteBuffer b = LocalManagement::readFile(repository + "/" + caName + "/cam.txt");
- String cam(b.data(), b.size());
+ std::string cam(b.data(), b.size());
- std::vectorblocxx::String lines = convStringArray(PerlRegEx("\n").split(cam));
+ std::vectorstd::string lines = PerlRegEx("\n").split(cam);
- std::vectorblocxx::String::const_iterator line;
- String camNew;
+ std::vectorstd::string::const_iterator line;
+ std::string camNew;
for(line = lines.begin(); line != lines.end(); ++line)
{
@@ -1979,25 +2004,25 @@
}
-std::vectorblocxx::String >
-OpenSSLUtils::parseCAMDB(const String &caName,
- const String &repository)
+std::vectorstd::string >
+OpenSSLUtils::parseCAMDB(const std::string &caName,
+ const std::string &repository)
{
- std::vector ret;
+ std::vectorstd::string > ret;
ByteBuffer b = LocalManagement::readFile(repository + "/" + caName + "/cam.txt");
- String cam(b.data(), b.size());
+ std::string cam(b.data(), b.size());
- std::vectorblocxx::String lines = convStringArray(PerlRegEx("\n").split(cam));
+ std::vectorstd::string lines = PerlRegEx("\n").split(cam);
- std::vectorblocxx::String::const_iterator line;
+ std::vectorstd::string::const_iterator line;
for(line = lines.begin(); line != lines.end(); ++line)
{
PerlRegEx r("^([[:xdigit:]]+[\\d-]*)\\s(.*)$");
- std::vectorblocxx::String col = convStringArray(r.capture(*line));
+ std::vectorstd::string col = r.capture(*line);
if(col.size() != 3)
{
@@ -2005,7 +2030,7 @@
continue;
}
- std::vector<String> a;
+ std::vectorstd::string a;
a.push_back(col[1]);
a.push_back(col[2]);
ret.push_back(a);
@@ -2013,25 +2038,25 @@
return ret;
}
-std::vectorblocxx::String >
-OpenSSLUtils::parseIndexTXT(const String &caName,
- const String &repository)
+std::vectorstd::string >
+OpenSSLUtils::parseIndexTXT(const std::string &caName,
+ const std::string &repository)
{
- std::vector ret;
+ std::vectorstd::string > ret;
ByteBuffer b = LocalManagement::readFile(repository + "/" + caName + "/index.txt");
- String cam(b.data(), b.size());
+ std::string cam(b.data(), b.size());
- std::vectorblocxx::String lines = convStringArray(PerlRegEx("\n").split(cam));
+ std::vectorstd::string lines = PerlRegEx("\n").split(cam);
- std::vectorblocxx::String::const_iterator line;
+ std::vectorstd::string::const_iterator line;
for(line = lines.begin(); line != lines.end(); ++line)
{
PerlRegEx r("^(\\w)\\s([\\d\\w]+)\\s([\\w\\d,.]*)\\s([[:xdigit:]]+)\\s(\\w+)\\s(.*)$");
- std::vectorblocxx::String col = convStringArray(r.capture(*line));
+ std::vectorstd::string col = r.capture(*line);
if(col.size() != 7)
{
@@ -2039,7 +2064,7 @@
continue;
}
- std::vector<String> a;
+ std::vectorstd::string a;
a.push_back(col[1]);
a.push_back(col[2]);
a.push_back(col[3]);
@@ -2051,14 +2076,14 @@
return ret;
}
-std::vector >
-OpenSSLUtils::listRequests(const String &caName,
- const String &repository)
+std::vector >
+OpenSSLUtils::listRequests(const std::string &caName,
+ const std::string &repository)
{
- std::vector > ret;
- std::list<String> tmpList;
+ std::vector > ret;
+ std::liststd::string tmpList;
- String reqDir = repository + "/" + caName + "/req/";
+ std::string reqDir = repository + "/" + caName + "/req/";
int r = path::readDir(tmpList, reqDir , false);
@@ -2067,14 +2092,14 @@
LOGIT_ERROR("Cannot read directory: " << reqDir <<
"(" << System::errorMsg(r) << ") [" << r << "]");
BLOCXX_THROW(ca_mgm::SystemException,
- Format(__("Cannot read directory: %1 (%2) [%3]."),
- reqDir, System::errorMsg(r), r).c_str());
+ str::form(__("Cannot read directory: %s (%s) [%d]."),
+ reqDir.c_str(), ::strerror(r), r).c_str());
}
tmpList.sort();
- std::vector camdb = OpenSSLUtils::parseCAMDB(caName, repository);
- std::list<String>::const_iterator cont;
+ std::vectorstd::string > camdb = OpenSSLUtils::parseCAMDB(caName, repository);
+ std::liststd::string::const_iterator cont;
path::PathInfo pi(reqDir);
for(cont = tmpList.begin(); cont != tmpList.end(); ++cont)
@@ -2089,7 +2114,7 @@
PerlRegEx requestR("^([[:xdigit:]]+)-?(\\d*)\\.req$");
- std::vectorblocxx::String sa = convStringArray(requestR.capture(*cont));
+ std::vectorstd::string sa = requestR.capture(*cont);
if(sa.size() <= 1)
{
@@ -2097,24 +2122,24 @@
continue;
}
- String md5 = sa[1];
- String date;
+ std::string md5 = sa[1];
+ std::string date;
if(sa.size() == 3 && !sa[2].empty())
{
md5 += "-" + sa[2];
- Date dt( sa[2].toInt64() );
- date = String(dt.form("%Y-%m-%d %H:%M:%S"));
+ Date dt( str::strtonum(sa[2]) );
+ date = std::string(dt.form("%Y-%m-%d %H:%M:%S"));
}
- std::map reqLine;
- String subject;
+ std::map reqLine;
+ std::string subject;
reqLine["request"] = md5;
reqLine["date"] = date;
- std::vector::const_iterator dbIT;
+ std::vectorstd::string >::const_iterator dbIT;
for(dbIT = camdb.begin(); dbIT != camdb.end(); ++dbIT)
{
if( (*dbIT)[0] == md5 )
@@ -2134,7 +2159,7 @@
sa.clear();
while(1)
{
- std::vectorblocxx::String saTmp = convStringArray(PerlRegEx("(.*?[^\\\\])(\\/|$)").capture(subject));
+ std::vectorstd::string saTmp = PerlRegEx("(.*?[^\\\\])(\\/|$)").capture(subject);
uint pos = 0;
if(saTmp.size() >=2)
@@ -2146,7 +2171,7 @@
{
break;
}
- subject = subject.substring(pos);
+ subject = subject.substr(pos);
}
PerlRegEx cR("^C=");
@@ -2159,39 +2184,39 @@
PerlRegEx quoteR("\\\\/");
- std::vectorblocxx::String::const_iterator it;
+ std::vectorstd::string::const_iterator it;
for(it = sa.begin(); it != sa.end(); ++it)
{
- String toMatch = quoteR.replace(*it, "/", true);
+ std::string toMatch = quoteR.replace(*it, "/", true);
toMatch = PerlRegEx("^/").replace(toMatch, "");
if(cR.match(toMatch))
{
- reqLine["country"] = toMatch.substring(2);
+ reqLine["country"] = toMatch.substr(2);
}
else if(stR.match(toMatch))
{
- reqLine["stateOrProvinceName"] = toMatch.substring(3);
+ reqLine["stateOrProvinceName"] = toMatch.substr(3);
}
else if(lR.match(toMatch))
{
- reqLine["localityName"] = toMatch.substring(2);
+ reqLine["localityName"] = toMatch.substr(2);
}
else if(oR.match(toMatch))
{
- reqLine["organizationName"] = toMatch.substring(2);
+ reqLine["organizationName"] = toMatch.substr(2);
}
else if(ouR.match(toMatch))
{
- reqLine["organizationalUnitName"] = toMatch.substring(3);
+ reqLine["organizationalUnitName"] = toMatch.substr(3);
}
else if(cnR.match(toMatch))
{
- reqLine["commonName"] = toMatch.substring(3);
+ reqLine["commonName"] = toMatch.substr(3);
}
else if(emailR.match(toMatch))
{
- reqLine["emailAddress"] = toMatch.substring(13);
+ reqLine["emailAddress"] = toMatch.substr(13);
}
else
{
@@ -2203,14 +2228,14 @@
return ret;
}
-std::vector >
-OpenSSLUtils::listCertificates(const String &caName,
- const String &repository)
+std::vector >
+OpenSSLUtils::listCertificates(const std::string &caName,
+ const std::string &repository)
{
- std::vector > ret;
- std::list<String> tmpList;
+ std::vector > ret;
+ std::liststd::string tmpList;
- String certDir = repository + "/" + caName + "/newcerts/";
+ std::string certDir = repository + "/" + caName + "/newcerts/";
int r = path::readDir(tmpList, certDir , false);
@@ -2219,14 +2244,14 @@
LOGIT_ERROR("Cannot read directory: " << certDir <<
"(" << System::errorMsg(r) << ") [" << r << "]");
BLOCXX_THROW(ca_mgm::SystemException,
- Format(__("Cannot read directory: %1 (%2) [%3]."),
- certDir, System::errorMsg(r), r).c_str());
+ str::form(__("Cannot read directory: %s (%s) [%d]."),
+ certDir.c_str(), ::strerror(r), r).c_str());
}
tmpList.sort();
- std::vector indexTXT = OpenSSLUtils::parseIndexTXT(caName, repository);
- std::list<String>::const_iterator cont;
+ std::vectorstd::string > indexTXT = OpenSSLUtils::parseIndexTXT(caName, repository);
+ std::liststd::string::const_iterator cont;
path::PathInfo pi(certDir);
for(cont = tmpList.begin(); cont != tmpList.end(); ++cont)
@@ -2241,7 +2266,7 @@
PerlRegEx certR("^([[:xdigit:]]+):([[:xdigit:]]+-?\\d*)\\.pem$");
- std::vectorblocxx::String sa = convStringArray(certR.capture(*cont));
+ std::vectorstd::string sa = certR.capture(*cont);
if(sa.size() != 3)
{
@@ -2249,16 +2274,16 @@
continue;
}
- String serial = sa[1];
- String md5 = sa[2];
+ std::string serial = sa[1];
+ std::string md5 = sa[2];
- std::map certLine;
- String subject;
+ std::map certLine;
+ std::string subject;
certLine["serial"] = serial;
certLine["certificate"] = serial + ":" + md5;
- std::vector::const_iterator dbIT;
+ std::vectorstd::string >::const_iterator dbIT;
for(dbIT = indexTXT.begin(); dbIT != indexTXT.end(); ++dbIT)
{
if( (*dbIT)[3] == serial )
@@ -2295,7 +2320,7 @@
sa.clear();
while(1)
{
- std::vectorblocxx::String saTmp = convStringArray(PerlRegEx("(.*?[^\\\\])(\\/|$)").capture(subject));
+ std::vectorstd::string saTmp = PerlRegEx("(.*?[^\\\\])(\\/|$)").capture(subject);
uint pos = 0;
if(saTmp.size() >=2)
@@ -2307,7 +2332,7 @@
{
break;
}
- subject = subject.substring(pos);
+ subject = subject.substr(pos);
}
PerlRegEx cR("^C=");
@@ -2320,54 +2345,54 @@
PerlRegEx quoteR("\\\\/");
- std::vectorblocxx::String::const_iterator it;
- String lastPart;
+ std::vectorstd::string::const_iterator it;
+ std::string lastPart;
for(it = sa.begin(); it != sa.end(); ++it)
{
- String toMatch = quoteR.replace(*it, "/", true);
+ std::string toMatch = quoteR.replace(*it, "/", true);
toMatch = PerlRegEx("^/").replace(toMatch, "");
if(cR.match(toMatch))
{
- certLine["country"] = toMatch.substring(2);
+ certLine["country"] = toMatch.substr(2);
lastPart = "country";
}
else if(stR.match(toMatch))
{
- certLine["stateOrProvinceName"] = toMatch.substring(3);
+ certLine["stateOrProvinceName"] = toMatch.substr(3);
lastPart = "stateOrProvinceName";
}
else if(lR.match(toMatch))
{
- certLine["localityName"] = toMatch.substring(2);
+ certLine["localityName"] = toMatch.substr(2);
lastPart = "localityName";
}
else if(oR.match(toMatch))
{
- certLine["organizationName"] = toMatch.substring(2);
+ certLine["organizationName"] = toMatch.substr(2);
lastPart = "organizationName";
}
else if(ouR.match(toMatch))
{
- certLine["organizationalUnitName"] = toMatch.substring(3);
+ certLine["organizationalUnitName"] = toMatch.substr(3);
lastPart = "organizationalUnitName";
}
else if(cnR.match(toMatch))
{
- certLine["commonName"] = toMatch.substring(3);
+ certLine["commonName"] = toMatch.substr(3);
lastPart = "commonName";
}
else if(emailR.match(toMatch))
{
- certLine["emailAddress"] = toMatch.substring(13);
+ certLine["emailAddress"] = toMatch.substr(13);
lastPart = "emailAddress";
}
else
{
- if(!lastPart.empty() && (*it).charAt(0) == '/')
+ if(!lastPart.empty() && (*it).at(0) == '/')
{
certLine[lastPart] = certLine[lastPart] + *it;
- LOGIT_DEBUG(Format("Append '%1' to %2", *it, lastPart));
+ LOGIT_DEBUG(str::form("Append '%s' to %s", (*it).c_str(), lastPart.c_str()));
}
else
{
@@ -2381,14 +2406,14 @@
}
void
-OpenSSLUtils::createCaInfrastructure(const String &caName,
- const String &repository)
+OpenSSLUtils::createCaInfrastructure(const std::string &caName,
+ const std::string &repository)
{
if(caName.empty() || !PerlRegEx("\\w+").match(caName))
{
LOGIT_ERROR("Invalid caName: " << caName);
BLOCXX_THROW(ca_mgm::ValueException,
- Format(__("Invalid caName: %1."), caName).c_str());
+ str::form(__("Invalid caName: %s."), caName.c_str()).c_str());
}
path::PathInfo pi(repository);
@@ -2397,7 +2422,7 @@
{
LOGIT_ERROR(repository << " does not exist");
BLOCXX_THROW_ERR(ca_mgm::SystemException,
- Format(__("'%1' does not exist."), repository).c_str(),
+ str::form(__("'%s' does not exist."), repository.c_str()).c_str(),
E_FILE_NOT_FOUND);
}
@@ -2407,7 +2432,7 @@
{
LOGIT_ERROR(pi.toString() << " still exist");
BLOCXX_THROW_ERR(ca_mgm::SystemException,
- Format(__("%1 still exists."), pi.toString()).c_str(),
+ str::form(__("%s still exists."), pi.toString().c_str()).c_str(),
E_FILE_EXISTS);
}
@@ -2415,11 +2440,11 @@
if( r != 0 )
{
- LOGIT_ERROR(Format("Can not create directory: %1 (%2 [%3])",
- pi.toString(), System::errorMsg(r), r));
+ LOGIT_ERROR(Format("Can not create directory: %s (%s [%d])",
+ pi.toString().c_str(), ::strerror(r), r));
BLOCXX_THROW(ca_mgm::SystemException,
- Format(__("Cannot create directory: %1 (%2 [%3])."),
- pi.toString(), System::errorMsg(r), r).c_str());
+ str::form(__("Cannot create directory: %s (%s [%d])."),
+ pi.toString().c_str(), ::strerror(r), r).c_str());
}
ByteBuffer tmpl;
@@ -2427,11 +2452,11 @@
{
tmpl = LocalManagement::readFile(repository + "/openssl.cnf.tmpl");
- std::vectorblocxx::String tmplArray = convStringArray(PerlRegEx("\n").split(String(tmpl.data(), tmpl.size()), true));
+ std::vectorstd::string tmplArray = PerlRegEx("\n").split(std::string(tmpl.data(), tmpl.size()), true);
PerlRegEx dirR("^\\s*dir\\s*=");
- String newConf;
- std::vectorblocxx::String::const_iterator line;
+ std::string newConf;
+ std::vectorstd::string::const_iterator line;
for(line = tmplArray.begin(); line != tmplArray.end(); ++line)
{
@@ -2456,18 +2481,18 @@
__("Cannot copy the configuration template."), e);
}
- String dir = pi.toString() + "/certs";
+ std::string dir = pi.toString() + "/certs";
r = path::createDir(dir, 0700);
if( r != 0 )
{
path::removeDirRecursive(repository + "/" + caName);
- LOGIT_ERROR(Format("Can not create directory: %1 (%2 [%3])",
- dir, System::errorMsg(r), r));
+ LOGIT_ERROR(Format("Can not create directory: %s (%s [%d])",
+ dir.c_str(), ::strerror(r), r));
BLOCXX_THROW(ca_mgm::SystemException,
- Format(__("Cannot create directory: %1 (%2 [%3])."),
- dir, System::errorMsg(r), r).c_str());
+ str::form(__("Cannot create directory: %s (%s [%d])."),
+ dir.c_str(), ::strerror(r), r).c_str());
}
dir = pi.toString() + "/crl";
@@ -2477,11 +2502,11 @@
{
path::removeDirRecursive(repository + "/" + caName);
- LOGIT_ERROR(Format("Can not create directory: %1 (%2 [%3])",
- dir, System::errorMsg(r), r));
+ LOGIT_ERROR(Format("Can not create directory: %s (%s [%d])",
+ dir.c_str(), ::strerror(r), r));
BLOCXX_THROW(ca_mgm::SystemException,
- Format(__("Cannot create directory: %1 (%2 [%3])."),
- dir, System::errorMsg(r), r).c_str());
+ str::form(__("Cannot create directory: %s (%s [%d])."),
+ dir.c_str(), ::strerror(r), r).c_str());
}
dir = pi.toString() + "/newcerts";
@@ -2491,11 +2516,11 @@
{
path::removeDirRecursive(repository + "/" + caName);
- LOGIT_ERROR(Format("Can not create directory: %1 (%2 [%3])",
- dir, System::errorMsg(r), r));
+ LOGIT_ERROR(Format("Can not create directory: %s (%s [%d])",
+ dir.c_str(), ::strerror(r), r));
BLOCXX_THROW(ca_mgm::SystemException,
- Format(__("Cannot create directory: %1 (%2 [%3])."),
- dir, System::errorMsg(r), r).c_str());
+ str::form(__("Cannot create directory: %s (%s [%d])."),
+ dir.c_str(), ::strerror(r), r).c_str());
}
dir = pi.toString() + "/req";
@@ -2505,11 +2530,11 @@
{
path::removeDirRecursive(repository + "/" + caName);
- LOGIT_ERROR(Format("Can not create directory: %1 (%2 [%3])",
- dir, System::errorMsg(r), r));
+ LOGIT_ERROR(Format("Can not create directory: %s (%s [%d])",
+ dir.c_str(), ::strerror(r), r));
BLOCXX_THROW(ca_mgm::SystemException,
- Format(__("Cannot create directory: %1 (%2 [%3])."),
- dir, System::errorMsg(r), r).c_str());
+ str::form(__("Cannot create directory: %s (%s [%d])."),
+ dir.c_str(), ::strerror(r), r).c_str());
}
dir = pi.toString() + "/keys";
@@ -2519,11 +2544,11 @@
{
path::removeDirRecursive(repository + "/" + caName);
- LOGIT_ERROR(Format("Can not create directory: %1 (%2 [%3])",
- dir, System::errorMsg(r), r));
+ LOGIT_ERROR(Format("Can not create directory: %s (%s [%d])",
+ dir.c_str(), ::strerror(r), r));
BLOCXX_THROW(ca_mgm::SystemException,
- Format(__("Cannot create directory: %1 (%2 [%3])."),
- dir, System::errorMsg(r), r).c_str());
+ str::form(__("Cannot create directory: %s (%s [%d])."),
+ dir.c_str(), ::strerror(r), r).c_str());
}
try
@@ -2544,4 +2569,64 @@
}
}
+std::string
+OpenSSLUtils::digestMD5(const std::string &in)
+{
+ std::string dcmd;
+ bool foundError = false;
+
+ dcmd += ca_mgm::OPENSSL_COMMAND + " ";
+ dcmd += "dgst ";
+ dcmd += "-md5 ";
+
+ std::vectorstd::string cmd = PerlRegEx("\\s").split(dcmd);
+
+ LOGIT_DEBUG("Command: " << dcmd);
+
+ std::string randfile(::tempnam("/tmp/", ".rand-"));
+ blocxx::EnvVars env;
+ env.addVar("PATH", "/usr/bin/");
+ env.addVar("RANDFILE", randfile.c_str());
+
+ std::string stdOutput;
+ std::string errOutput;
+ int status = -1;
+
+ try
+ {
+ status = wrapExecuteProcessAndGatherOutput(cmd, stdOutput,
+ errOutput, env,
+ -1, -1, in);
+ }
+ catch(blocxx::Exception& e)
+ {
+ LOGIT_ERROR( "openssl exception:" << e);
+ path::removeFile(randfile);
+ BLOCXX_THROW_SUBEX(ca_mgm::RuntimeException,
+ __("Executing openssl command failed."), e);
+ }
+ if(status != 0)
+ {
+ LOGIT_INFO( "openssl status:" << str::numstring(status));
+ foundError = true;
+ }
+ if(!errOutput.empty())
+ {
+ LOGIT_ERROR("openssl stderr:" << errOutput);
+ foundError = true;
+ }
+ if(!stdOutput.empty())
+ {
+ LOGIT_DEBUG("openssl stdout:" << stdOutput);
+ }
+ path::removeFile(randfile);
+
+ if(foundError)
+ {
+ BLOCXX_THROW(ca_mgm::RuntimeException,
+ str::form(__("openssl command failed: %s"), errOutput.c_str()).c_str());
+ }
+ return stdOutput;
+}
+
}
Modified: limal-branches/mc-devel/limal-ca-mgm/src/OpenSSLUtils.hpp
URL: http://svn.opensuse.org/viewcvs/limal/limal-branches/mc-devel/limal-ca-mgm/src/OpenSSLUtils.hpp?rev=2675&r1=2674&r2=2675&view=diff
==============================================================================
--- limal-branches/mc-devel/limal-ca-mgm/src/OpenSSLUtils.hpp (original)
+++ limal-branches/mc-devel/limal-ca-mgm/src/OpenSSLUtils.hpp Sat Jul 3 13:27:18 2010
@@ -39,75 +39,75 @@
public:
- OpenSSLUtils(const blocxx::String &onfigFile,
- const blocxx::String &command = OPENSSL_COMMAND,
- const blocxx::String &tmpDir = "/tmp/");
+ OpenSSLUtils(const std::string &onfigFile,
+ const std::string &command = OPENSSL_COMMAND,
+ const std::string &tmpDir = "/tmp/");
- void createRSAKey(const blocxx::String &outFile,
- const blocxx::String &password,
+ void createRSAKey(const std::string &outFile,
+ const std::string &password,
uint32_t bits = 2048,
- const blocxx::String &cryptAlgorithm = "des3");
+ const std::string &cryptAlgorithm = "des3");
void createRequest(const DNObject &dn,
- const blocxx::String &outFile,
- const blocxx::String &keyFile,
- const blocxx::String &password,
- const blocxx::String &extension,
+ const std::string &outFile,
+ const std::string &keyFile,
+ const std::string &password,
+ const std::string &extension,
FormatType outForm = E_PEM,
- const blocxx::String &challengePassword = "",
- const blocxx::String &unstructuredName = "");
+ const std::string &challengePassword = "",
+ const std::string &unstructuredName = "");
- void createSelfSignedCertificate(const blocxx::String &outFile,
- const blocxx::String &keyFile,
- const blocxx::String &requestFile,
- const blocxx::String &password,
- const blocxx::String &extension,
+ void createSelfSignedCertificate(const std::string &outFile,
+ const std::string &keyFile,
+ const std::string &requestFile,
+ const std::string &password,
+ const std::string &extension,
const uint32_t days,
bool noEmailDN = false);
- void signRequest(const blocxx::String &requestFile,
- const blocxx::String &outFile,
- const blocxx::String &caKeyFile,
- const blocxx::String &caPassword,
- const blocxx::String &extension,
- const blocxx::String &startDate,
- const blocxx::String &endDate,
- const blocxx::String &caSection,
- const blocxx::String &outDir = "",
+ void signRequest(const std::string &requestFile,
+ const std::string &outFile,
+ const std::string &caKeyFile,
+ const std::string &caPassword,
+ const std::string &extension,
+ const std::string &startDate,
+ const std::string &endDate,
+ const std::string &caSection,
+ const std::string &outDir = "",
bool noEmailDN = false,
bool noUniqueDN = false,
bool noText = true);
- void revokeCertificate(const blocxx::String &caCertFile,
- const blocxx::String &caKeyFile,
- const blocxx::String &caPassword,
- const blocxx::String &certFile,
+ void revokeCertificate(const std::string &caCertFile,
+ const std::string &caKeyFile,
+ const std::string &caPassword,
+ const std::string &certFile,
const CRLReason &reason = CRLReason(),
bool noUniqueDN = false);
- void issueCRL(const blocxx::String &caCertFile,
- const blocxx::String &caKeyFile,
- const blocxx::String &caPassword,
+ void issueCRL(const std::string &caCertFile,
+ const std::string &caKeyFile,
+ const std::string &caPassword,
uint32_t hours,
- const blocxx::String &outfile,
- const blocxx::String &extension,
+ const std::string &outfile,
+ const std::string &extension,
bool noUniqueDN = false);
- void updateDB(const blocxx::String &caCertFile,
- const blocxx::String &caKeyFile,
- const blocxx::String &caPassword);
+ void updateDB(const std::string &caCertFile,
+ const std::string &caKeyFile,
+ const std::string &caPassword);
- blocxx::String verify(const blocxx::String &certFile,
- const blocxx::String &caPath,
+ std::string verify(const std::string &certFile,
+ const std::string &caPath,
bool crlCheck = false,
- const blocxx::String &purpose = "");
+ const std::string &purpose = "");
- blocxx::String status(const blocxx::String &serial);
+ std::string status(const std::string &serial);
- bool checkKey(const blocxx::String &caName,
- const blocxx::String &password,
- const blocxx::String &certificateName = "cacert",
- const blocxx::String &repository = REPOSITORY);
+ bool checkKey(const std::string &caName,
+ const std::string &password,
+ const std::string &certificateName = "cacert",
+ const std::string &repository = REPOSITORY);
// ###################################################
@@ -123,9 +123,9 @@
rsaConvert(const ByteBuffer &key,
FormatType inform,
FormatType outform,
- const String &inPassword,
- const String &outPassword,
- const String &algorithm = "des3" );
+ const std::string &inPassword,
+ const std::string &outPassword,
+ const std::string &algorithm = "des3" );
static ByteBuffer
crlConvert(const ByteBuffer &crl,
@@ -143,10 +143,10 @@
static ByteBuffer
createPKCS12(const ByteBuffer &certificate,
const ByteBuffer &key,
- const String &inPassword,
- const String &outPassword,
+ const std::string &inPassword,
+ const std::string &outPassword,
const ByteBuffer &caCert,
- const String &caPath,
+ const std::string &caPath,
bool withChain );
/**
@@ -154,53 +154,56 @@
*/
static ByteBuffer
pkcs12ToPEM(const ByteBuffer &pkcs12,
- const String &inPassword,
- const String &outPassword,
- const String &algorithm = "des3");
+ const std::string &inPassword,
+ const std::string &outPassword,
+ const std::string &algorithm = "des3");
- static std::vectorblocxx::String
- listCA(const String &repository = REPOSITORY);
+ static std::vectorstd::string
+ listCA(const std::string &repository = REPOSITORY);
- static blocxx::String
- nextSerial(const String &serialFile);
+ static std::string
+ nextSerial(const std::string &serialFile);
static void
- addCAM(const String &caName,
- const String &md5,
- const String &dnString,
- const String &repository = REPOSITORY);
+ addCAM(const std::string &caName,
+ const std::string &md5,
+ const std::string &dnString,
+ const std::string &repository = REPOSITORY);
static void
- delCAM(const String &caName,
- const String &md5,
- const String &repository = REPOSITORY);
-
- static std::vectorblocxx::String >
- parseCAMDB(const String &caName,
- const String &repository = REPOSITORY);
-
- static std::vectorblocxx::String >
- parseIndexTXT(const String &caName,
- const String &repository = REPOSITORY);
-
- static std::vector >
- listRequests(const String &caName,
- const String &repository = REPOSITORY);
-
- static std::vector >
- listCertificates(const String &caName,
- const String &repository = REPOSITORY);
+ delCAM(const std::string &caName,
+ const std::string &md5,
+ const std::string &repository = REPOSITORY);
+
+ static std::vectorstd::string >
+ parseCAMDB(const std::string &caName,
+ const std::string &repository = REPOSITORY);
+
+ static std::vectorstd::string >
+ parseIndexTXT(const std::string &caName,
+ const std::string &repository = REPOSITORY);
+
+ static std::vector >
+ listRequests(const std::string &caName,
+ const std::string &repository = REPOSITORY);
+
+ static std::vector >
+ listCertificates(const std::string &caName,
+ const std::string &repository = REPOSITORY);
static void
- createCaInfrastructure(const String &caName,
- const String &repository = REPOSITORY);
+ createCaInfrastructure(const std::string &caName,
+ const std::string &repository = REPOSITORY);
+
+ static std::string
+ digestMD5(const std::string &in);
private:
- blocxx::String m_cmd;
- blocxx::String m_tmp;
- blocxx::String m_conf;
- blocxx::String m_rand;
+ std::string m_cmd;
+ std::string m_tmp;
+ std::string m_conf;
+ std::string m_rand;
OpenSSLUtils();
OpenSSLUtils(const OpenSSLUtils&);
Modified: limal-branches/mc-devel/limal-ca-mgm/src/PathInfo.cpp
URL: http://svn.opensuse.org/viewcvs/limal/limal-branches/mc-devel/limal-ca-mgm/src/PathInfo.cpp?rev=2675&r1=2674&r2=2675&view=diff
==============================================================================
--- limal-branches/mc-devel/limal-ca-mgm/src/PathInfo.cpp (original)
+++ limal-branches/mc-devel/limal-ca-mgm/src/PathInfo.cpp Sat Jul 3 13:27:18 2010
@@ -70,7 +70,7 @@
//
// DESCRIPTION :
//
-PathInfo::PathInfo( const String & path, Mode initial )
+PathInfo::PathInfo( const std::string & path, Mode initial )
: m_path( path )
, m_mode( initial )
, m_error( -1 )
Modified: limal-branches/mc-devel/limal-ca-mgm/src/PathName.cpp
URL: http://svn.opensuse.org/viewcvs/limal/limal-branches/mc-devel/limal-ca-mgm/src/PathName.cpp?rev=2675&r1=2674&r2=2675&view=diff
==============================================================================
--- limal-branches/mc-devel/limal-ca-mgm/src/PathName.cpp (original)
+++ limal-branches/mc-devel/limal-ca-mgm/src/PathName.cpp Sat Jul 3 13:27:18 2010
@@ -38,7 +38,7 @@
#include
#include
#include
-#include
+#include
#include "Utils.hpp"
#include <iostream>
@@ -66,7 +66,7 @@
{
size_t
- findTildeEnd(const String &name)
+ findTildeEnd(const std::string &name)
{
const char *beg, *end;
@@ -80,31 +80,31 @@
return end - beg;
}
} while( *end++);
- return String::npos;
+ return std::string::npos;
}
- String
- expandTilde(const String &name)
+ std::string
+ expandTilde(const std::string &name)
{
// FIXME: improve blocxx::UserInfo and use it!!!
- if( name.startsWith('~'))
+ if( name.compare(0, 1, "~") == 0)
{
- String user;
- String home;
- String rest;
+ std::string user;
+ std::string home;
+ std::string rest;
size_t end = findTildeEnd(name);
- user = name.substring(1, end);
- rest = name.substring(end);
+ user = name.substr(1, end);
+ rest = name.substr(end);
if( user.empty())
{
if( ::getuid() != ::geteuid())
{
EnvVars env(EnvVars::E_CURRENT_ENVIRONMENT);
- home = env.getValue("HOME");
+ home = env.getValue("HOME").c_str();
- if( home.startsWith('~'))
+ if( home.compare(0, 1, "~") == 0)
home = "";
}
@@ -119,8 +119,8 @@
::endpwent();
}
}
- else if(('a' <= user[0] && user[0] <= 'z' ||
- 'A' <= user[0] && user[0] <= 'Z'))
+ else if(('a' <= user[0] && user[0] <= 'z') ||
+ ('A' <= user[0] && user[0] <= 'Z'))
{
::setpwent();
struct passwd *pw = ::getpwnam(user.c_str());
@@ -140,13 +140,13 @@
}
inline size_t
- withDrivePrefix(const String &name)
+ withDrivePrefix(const std::string &name)
{
size_t len = name.length();
return (len >= 2 && name[1] == ':' &&
- ('a' <= name[0] && name[0] <= 'z' ||
- 'A' <= name[0] && name[0] <= 'Z')) ? len : 0;
+ (('a' <= name[0] && name[0] <= 'z') ||
+ ('A' <= name[0] && name[0] <= 'Z'))) ? len : 0;
}
class DirStack
@@ -183,15 +183,15 @@
}
void
- push(const String &name)
+ push(const std::string &name)
{
- if( name.indexOf('/') != String::npos ||
- name.indexOf('\\') != String::npos)
+ if( name.find_first_of('/') != std::string::npos ||
+ name.find_first_of('\\') != std::string::npos)
{
BLOCXX_THROW(ca_mgm::ValueException,
- Format(__("The specified filename component '%1' "
+ str::form(__("The specified filename component '%s' "
"contains a filename separator"),
- name).c_str()
+ name.c_str()).c_str()
);
}
@@ -231,7 +231,7 @@
}
void
- split(const String &path)
+ split(const std::string &path)
{
const char *beg, *end;
@@ -244,7 +244,7 @@
case '\\':
case '\0':
if( end > beg)
- push(String(beg, end - beg));
+ push(std::string(beg, end - beg));
else
push("");
beg = end + 1;
@@ -259,13 +259,13 @@
return m_list;
}
- String
- getPathName(const String &sep = BLOCXX_FILENAME_SEPARATOR) const
+ std::string
+ getPathName(const std::string &sep = BLOCXX_FILENAME_SEPARATOR) const
{
if( m_first)
return "";
- String path;
+ std::string path;
PathName::List::const_iterator i(m_list.begin());
for( ; i != m_list.end(); ++i)
{
@@ -310,7 +310,7 @@
// -------------------------------------------------------------------
-PathName::PathName(const blocxx::String &name)
+PathName::PathName(const std::string &name)
: m_prefix(0)
{
assign( name);
@@ -343,7 +343,7 @@
PathName::List::const_iterator item(list.begin());
- String drive;
+ std::string drive;
size_t prefix = withDrivePrefix(*item);
if( prefix)
@@ -384,7 +384,7 @@
// -------------------------------------------------------------------
void
-PathName::assign(const String &name)
+PathName::assign(const std::string &name)
{
m_prefix = 0;
m_name = "";
@@ -392,14 +392,14 @@
if ( name.empty())
return;
- String drive;
- String path(name);
+ std::string drive;
+ std::string path(name);
size_t prefix = 0;
if( withDrivePrefix(path))
{
prefix = 2;
- drive = path.substring(0, 2);
+ drive = path.substr(0, 2);
}
else
{
@@ -407,7 +407,7 @@
if( withDrivePrefix(path))
{
prefix = 2;
- drive = path.substring(0, 2);
+ drive = path.substr(0, 2);
}
}
@@ -420,7 +420,7 @@
// -------------------------------------------------------------------
-blocxx::String
+std::string
PathName::toString() const
{
return m_name;
@@ -447,10 +447,10 @@
// -------------------------------------------------------------------
-blocxx::String
+std::string
PathName::prefix() const
{
- return m_name.empty() ? "" : m_name.substring(0, m_prefix);
+ return m_name.empty() ? "" : m_name.substr(0, m_prefix);
}
@@ -489,7 +489,7 @@
// -------------------------------------------------------------------
-blocxx::String
+std::string
PathName::baseName() const
{
return baseName( *this);
@@ -522,8 +522,8 @@
PathName ret( name);
- size_t idx = ret.m_name.lastIndexOf( BLOCXX_FILENAME_SEPARATOR_C);
- if ( idx == String::npos)
+ size_t idx = ret.m_name.find_last_of( BLOCXX_FILENAME_SEPARATOR_C);
+ if ( idx == std::string::npos)
{
ret.m_name.erase( ret.m_prefix);
ret.m_name += ".";
@@ -544,17 +544,17 @@
// -------------------------------------------------------------------
// STATIC
-String
+std::string
PathName::baseName(const PathName &name)
{
if ( name.empty() )
return "";
- String ret( name.toString());
+ std::string ret( name.toString());
ret.erase( 0, name.m_prefix);
- size_t idx = ret.lastIndexOf( BLOCXX_FILENAME_SEPARATOR_C);
- if ( idx != String::npos)
+ size_t idx = ret.find_last_of( BLOCXX_FILENAME_SEPARATOR_C);
+ if ( idx != std::string::npos)
{
ret.erase( 0, idx + 1);
}
@@ -591,7 +591,7 @@
// -------------------------------------------------------------------
PathName
-PathName::extend(const blocxx::String &ext) const
+PathName::extend(const std::string &ext) const
{
return extend( *this, ext);
}
@@ -616,8 +616,8 @@
if ( name.empty())
return add;
- String ret = BLOCXX_FILENAME_SEPARATOR +
- add.toString().substring(add.m_prefix) ;
+ std::string ret = BLOCXX_FILENAME_SEPARATOR +
+ add.toString().substr(add.m_prefix) ;
return PathName(name.toString() + ret);
}
@@ -626,7 +626,7 @@
// -------------------------------------------------------------------
// STATIC
PathName
-PathName::extend(const PathName &name, const String &ext)
+PathName::extend(const PathName &name, const std::string &ext)
{
return PathName(name.toString() + ext);
}
Modified: limal-branches/mc-devel/limal-ca-mgm/src/PathUtils.cpp
URL: http://svn.opensuse.org/viewcvs/limal/limal-branches/mc-devel/limal-ca-mgm/src/PathUtils.cpp?rev=2675&r1=2674&r2=2675&view=diff
==============================================================================
--- limal-branches/mc-devel/limal-ca-mgm/src/PathUtils.cpp (original)
+++ limal-branches/mc-devel/limal-ca-mgm/src/PathUtils.cpp Sat Jul 3 13:27:18 2010
@@ -21,8 +21,7 @@
#include
#include
#include
-#include
-#include
+#include
#include "Utils.hpp"
#include
@@ -33,18 +32,18 @@
using namespace blocxx;
-inline static String mode2String(mode_t o) {
- String s;
+inline static std::string mode2String(mode_t o) {
+ std::string s;
//s.format("%#4o", o);
- s.format("0%03o", o);
+ s = str::form("0%03o", o);
return s;
}
-inline static String errno2String(int e) {
+inline static std::string errno2String(int e) {
char buf[blocxx::ExceptionDetail::BUFSZ];
blocxx::ExceptionDetail::portable_strerror_r(e, buf, sizeof(buf));
- String s(buf);
- s += "(" + String(e) + ")";
+ std::string s(buf);
+ s += "(" + str::numstring(e) + ")";
return s;
}
@@ -78,7 +77,7 @@
int createDirRecursive( const PathName & path, unsigned mode )
{
size_t pos, lastpos = 0;
- String spath = path.toString()+"/";
+ std::string spath = path.toString()+"/";
int ret = 0;
if(path.empty())
@@ -91,8 +90,8 @@
else
lastpos=1;
- while((pos = spath.indexOf('/',lastpos)) != String::npos ) {
- String dir = spath.substring(0,pos);
+ while((pos = spath.find_first_of('/',lastpos)) != std::string::npos ) {
+ std::string dir = spath.substr(0,pos);
ret = ::mkdir(dir.c_str(), mode);
if(ret == -1)
{
@@ -147,42 +146,24 @@
return ENOTDIR ;
}
- //std::vectorblocxx::String cmd;
- StringArray cmd;
+ std::vectorstd::string cmd;
cmd.push_back(RM_COMMAND);
cmd.push_back("-rf");
cmd.push_back("--preserve-root");
cmd.push_back("--");
cmd.push_back(path.toString());
- String stdOutput;
- String errOutput;
+ std::string stdOutput;
+ std::string errOutput;
int status = -1;
-#if BLOCXX_LIBRARY_VERSION >= 5
try {
- Process::Status ps;
- ps = Exec::executeProcessAndGatherOutput(
+ status = wrapExecuteProcessAndGatherOutput(
cmd, stdOutput, errOutput, EnvVars()
);
- if( ps.exitTerminated())
- status = ps.exitStatus();
}
catch(const blocxx::Exception &e) {
LOGIT_ERROR( "removeDirRecursive exception: " << e);
}
-#else
- try {
- int execStatus = -1;
- Exec::executeProcessAndGatherOutput(
- cmd, stdOutput, errOutput, execStatus, EnvVars()
- );
- if( execStatus != -1 && WIFEXITED(execStatus))
- status = WEXITSTATUS(execStatus);
- }
- catch(const blocxx::Exception &e) {
- LOGIT_ERROR( "removeDirRecursive exception: " << e);
- }
-#endif
if(status != 0) {
LOGIT_ERROR( "removeDirRecursive status: " << status );
}
@@ -224,40 +205,23 @@
return EEXIST ;
}
- StringArray cmd;
+ std::vectorstd::string cmd;
cmd.push_back(CP_COMMAND);
cmd.push_back("-a");
cmd.push_back(srcpath.toString());
cmd.push_back(destpath.toString());
- String stdOutput;
- String errOutput;
+ std::string stdOutput;
+ std::string errOutput;
int status = -1;
-#if BLOCXX_LIBRARY_VERSION >= 5
try {
- Process::Status ps;
- ps = Exec::executeProcessAndGatherOutput(
+ status = wrapExecuteProcessAndGatherOutput(
cmd, stdOutput, errOutput, EnvVars()
);
- if( ps.exitTerminated())
- status = ps.exitStatus();
- }
- catch(const blocxx::Exception &e) {
- LOGIT_ERROR( "copyDir exception: " << e);
- }
-#else
- try {
- int execStatus = -1;
- Exec::executeProcessAndGatherOutput(
- cmd, stdOutput, errOutput, execStatus, EnvVars()
- );
- if( execStatus != -1 && WIFEXITED(execStatus))
- status = WEXITSTATUS(execStatus);
}
catch(const blocxx::Exception &e) {
LOGIT_ERROR( "copyDir exception: " << e);
}
-#endif
if(status != 0) {
LOGIT_ERROR( "copyDir status: " << status );
}
@@ -279,7 +243,7 @@
//
// DESCRIPTION :
//
-int readDir( std::list<String> & retlist,
+int readDir( std::liststd::string & retlist,
const PathName & path, bool dots )
{
retlist.clear();
@@ -380,39 +344,22 @@
return EISDIR;
}
- StringArray cmd;
+ std::vectorstd::string cmd;
cmd.push_back(CP_COMMAND);
cmd.push_back(file.toString());
cmd.push_back(dest.toString());
- String stdOutput;
- String errOutput;
+ std::string stdOutput;
+ std::string errOutput;
int status = -1;
-#if BLOCXX_LIBRARY_VERSION >= 5
try {
- Process::Status ps;
- ps = Exec::executeProcessAndGatherOutput(
+ status = wrapExecuteProcessAndGatherOutput(
cmd, stdOutput, errOutput, EnvVars()
);
- if( ps.exitTerminated())
- status = ps.exitStatus();
- }
- catch(const blocxx::Exception &e) {
- LOGIT_ERROR( "copyFile exception: " << e);
- }
-#else
- try {
- int execStatus = -1;
- Exec::executeProcessAndGatherOutput(
- cmd, stdOutput, errOutput, execStatus, EnvVars()
- );
- if( execStatus != -1 && WIFEXITED(execStatus))
- status = WEXITSTATUS(execStatus);
}
catch(const blocxx::Exception &e) {
LOGIT_ERROR( "copyFile exception: " << e);
}
-#endif
if(status != 0) {
LOGIT_ERROR( "copyFile status:" << status );
}
Added: limal-branches/mc-devel/limal-ca-mgm/src/PosixRegEx.cpp
URL: http://svn.opensuse.org/viewcvs/limal/limal-branches/mc-devel/limal-ca-mgm/src/PosixRegEx.cpp?rev=2675&view=auto
==============================================================================
--- limal-branches/mc-devel/limal-ca-mgm/src/PosixRegEx.cpp (added)
+++ limal-branches/mc-devel/limal-ca-mgm/src/PosixRegEx.cpp Sat Jul 3 13:27:18 2010
@@ -0,0 +1,557 @@
+/*******************************************************************************
+* Copyright (C) 2005 Novell, Inc. All rights reserved.
+*
+* Redistribution and use in source and binary forms, with or without
+* modification, are permitted provided that the following conditions are met:
+*
+* - Redistributions of source code must retain the above copyright notice,
+* this list of conditions and the following disclaimer.
+*
+* - Redistributions in binary form must reproduce the above copyright notice,
+* this list of conditions and the following disclaimer in the documentation
+* and/or other materials provided with the distribution.
+*
+* - Neither the name of Quest Software, Inc., Novell, Inc., nor the names of its
+* contributors may be used to endorse or promote products derived from this
+* software without specific prior written permission.
+*
+* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
+* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+* ARE DISCLAIMED. IN NO EVENT SHALL Quest Software, Inc., Novell, Inc., OR THE
+* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
+* OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
+* WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
+* OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
+* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+*******************************************************************************/
+/**
+ * @author Marius Tomaschewski
+ */
+
+#include
+
+#include "limal/Exception.hpp"
+
+
+namespace ca_mgm
+{
+
+namespace
+{
+// the REG_NOERROR enum value from linux's regex.h is non-standard, so don't use it.
+const int REG_NOERROR = 0;
+}
+
+// -------------------------------------------------------------------
+static std::string
+substitute_caps(const PosixRegEx::MatchArray &sub,
+ const std::string &str, const std::string &rep)
+{
+ static const char *cap_refs[] = {
+ NULL, "\\1", "\\2", "\\3", "\\4",
+ "\\5", "\\6", "\\7", "\\8", "\\9", NULL
+ };
+
+ std::string res( rep);
+ size_t pos;
+
+ for(size_t i=1; cap_refs[i] != NULL; i++)
+ {
+ std::string cap;
+
+ if( i < sub.size() && sub[i].rm_so >= 0 && sub[i].rm_eo >= 0)
+ {
+ cap = str.substr(sub[i].rm_so, sub[i].rm_eo
+ - sub[i].rm_so);
+ }
+
+ pos = res.find_first_of(cap_refs[i]);
+ while( pos != std::string::npos)
+ {
+ size_t quotes = 0;
+ size_t at = pos;
+
+ while( at > 0 && res.at(--at) == '\\')
+ quotes++;
+
+ if( quotes % 2)
+ {
+ quotes = (quotes + 1) / 2;
+
+ res = res.erase(pos - quotes, quotes);
+
+ pos = res.find_first_of(cap_refs[i],
+ pos + 2 - quotes);
+ }
+ else
+ {
+ quotes = quotes / 2;
+
+ res = res.substr(0, pos - quotes) +
+ cap +
+ res.substr(pos + 2);
+
+ pos = res.find_first_of(cap_refs[i],
+ pos + cap.length() - quotes);
+ }
+ }
+ }
+ return res;
+}
+
+
+// -------------------------------------------------------------------
+static inline std::string
+getError(const regex_t *preg, const int code)
+{
+ char err[256] = { '\0'};
+ ::regerror(code, preg, err, sizeof(err));
+ return std::string(err);
+}
+
+
+// -------------------------------------------------------------------
+PosixRegEx::PosixRegEx()
+ : compiled(false)
+ , m_flags(0)
+ , m_ecode(REG_NOERROR)
+{
+}
+
+
+// -------------------------------------------------------------------
+PosixRegEx::PosixRegEx(const std::string ®ex, int cflags)
+ : compiled(false)
+ , m_flags(0)
+ , m_ecode(REG_NOERROR)
+{
+ if( !compile(regex, cflags))
+ {
+ BLOCXX_THROW_ERR(ca_mgm::ValueException,
+ errorString().c_str(), m_ecode);
+ }
+}
+
+
+// -------------------------------------------------------------------
+PosixRegEx::PosixRegEx(const PosixRegEx &ref)
+ : compiled(false)
+ , m_flags(ref.m_flags)
+ , m_ecode(REG_NOERROR)
+ , m_rxstr(ref.m_rxstr)
+{
+ if( ref.compiled && !compile(ref.m_rxstr, ref.m_flags))
+ {
+ BLOCXX_THROW_ERR(ca_mgm::ValueException,
+ errorString().c_str(), m_ecode);
+ }
+}
+
+
+// -------------------------------------------------------------------
+PosixRegEx::~PosixRegEx()
+{
+ if( compiled)
+ {
+ regfree(&m_regex);
+ }
+}
+
+
+// -------------------------------------------------------------------
+PosixRegEx &
+PosixRegEx::operator = (const PosixRegEx &ref)
+{
+ if( !ref.compiled)
+ {
+ m_ecode = REG_NOERROR;
+ m_error.erase();
+ m_flags = ref.m_flags;
+ m_rxstr = ref.m_rxstr;
+ if( compiled)
+ {
+ regfree(&m_regex);
+ compiled = false;
+ }
+ }
+ else if( !compile(ref.m_rxstr, ref.m_flags))
+ {
+ BLOCXX_THROW_ERR(ca_mgm::ValueException,
+ errorString().c_str(), m_ecode);
+ }
+ return *this;
+}
+
+
+// -------------------------------------------------------------------
+bool
+PosixRegEx::compile(const std::string ®ex, int cflags)
+{
+ if( compiled)
+ {
+ regfree(&m_regex);
+ compiled = false;
+ }
+
+ m_rxstr = regex;
+ m_flags = cflags;
+ m_ecode = ::regcomp(&m_regex, regex.c_str(), cflags);
+ if( m_ecode == REG_NOERROR)
+ {
+ compiled = true;
+ m_error.erase();
+ return true;
+ }
+ else
+ {
+ m_error = getError(&m_regex, m_ecode);
+ return false;
+ }
+}
+
+
+// -------------------------------------------------------------------
+int
+PosixRegEx::errorCode()
+{
+ return m_ecode;
+}
+
+
+// -------------------------------------------------------------------
+std::string
+PosixRegEx::errorString() const
+{
+ return m_error;
+}
+
+
+// -------------------------------------------------------------------
+std::string
+PosixRegEx::patternString() const
+{
+ return m_rxstr;
+}
+
+
+// -------------------------------------------------------------------
+int
+PosixRegEx::compileFlags() const
+{
+ return m_flags;
+}
+
+
+// -------------------------------------------------------------------
+bool
+PosixRegEx::isCompiled() const
+{
+ return compiled;
+}
+
+
+// -------------------------------------------------------------------
+bool
+PosixRegEx::execute(MatchArray &sub, const std::string &str,
+ size_t index, size_t count, int eflags)
+{
+ if( !compiled)
+ {
+ BLOCXX_THROW(ca_mgm::ValueException,
+ "Regular expression is not compiled");
+ }
+
+ if( index > str.length())
+ {
+ BLOCXX_THROW(ca_mgm::OverflowException,
+ str::form("String index out of bounds ("
+ "length = %d, index = %d).",
+ str.length(), index
+ ).c_str());
+ }
+
+ if( count == 0)
+ {
+ count = m_regex.re_nsub + 1;
+ }
+ regmatch_t rsub[count];
+ rsub[0].rm_so = -1;
+ rsub[0].rm_eo = -1;
+
+ sub.clear();
+ m_ecode = ::regexec(&m_regex, str.c_str() + index,
+ count, rsub, eflags);
+ if( m_ecode == REG_NOERROR)
+ {
+ m_error.erase();
+ if( m_flags & REG_NOSUB)
+ {
+ return true;
+ }
+
+ sub.resize(count);
+ for(size_t n = 0; n < count; n++)
+ {
+ if( rsub[n].rm_so < 0 || rsub[n].rm_eo < 0)
+ {
+ sub[n] = rsub[n];
+ }
+ else
+ {
+ rsub[n].rm_so += index;
+ rsub[n].rm_eo += index;
+ sub[n] = rsub[n];
+ }
+ }
+ return true;
+ }
+ else
+ {
+ m_error = getError(&m_regex, m_ecode);
+ return false;
+ }
+}
+
+
+// -------------------------------------------------------------------
+std::vectorstd::string
+PosixRegEx::capture(const std::string &str, size_t index, size_t count, int eflags)
+{
+ if( !compiled)
+ {
+ BLOCXX_THROW(ca_mgm::ValueException,
+ "Regular expression is not compiled");
+ }
+
+ MatchArray rsub;
+ std::vectorstd::string ssub;
+
+ bool match = execute(rsub, str, index, count, eflags);
+ if( match)
+ {
+ if( rsub.empty())
+ {
+ BLOCXX_THROW(ca_mgm::ValueException,
+ "Non-capturing regular expression");
+ }
+
+ MatchArray::const_iterator i=rsub.begin();
+ for( ; i != rsub.end(); ++i)
+ {
+ if( i->rm_so >= 0 && i->rm_eo >= 0)
+ {
+ ssub.push_back(str.substr(i->rm_so,
+ i->rm_eo - i->rm_so));
+ }
+ else
+ {
+ ssub.push_back(std::string(""));
+ }
+ }
+ }
+ else if(m_ecode != REG_NOMATCH)
+ {
+ BLOCXX_THROW_ERR(ca_mgm::RuntimeException,
+ errorString().c_str(), m_ecode);
+ }
+ return ssub;
+}
+
+
+// -------------------------------------------------------------------
+std::string
+PosixRegEx::replace(const std::string &str, const std::string &rep,
+ bool global, int eflags)
+{
+ if( !compiled)
+ {
+ BLOCXX_THROW(ca_mgm::ValueException,
+ "Regular expression is not compiled");
+ }
+
+ MatchArray rsub;
+ bool match;
+ size_t off = 0;
+ std::string out = str;
+
+ do
+ {
+ match = execute(rsub, out, off, 0, eflags);
+ if( match)
+ {
+ if( rsub.empty() ||
+ rsub[0].rm_so < 0 ||
+ rsub[0].rm_eo < 0)
+ {
+ // only if empty (missused as guard).
+ BLOCXX_THROW(ca_mgm::ValueException,
+ "Non-capturing regular expression");
+ }
+
+ std::string res = substitute_caps(rsub, out, rep);
+
+ out = out.substr(0, rsub[0].rm_so) +
+ res + out.substr(rsub[0].rm_eo);
+
+ off = rsub[0].rm_so + res.length();
+ }
+ else if(m_ecode == REG_NOMATCH)
+ {
+ m_ecode = REG_NOERROR;
+ m_error.erase();
+ }
+ else
+ {
+ BLOCXX_THROW_ERR(ca_mgm::RuntimeException,
+ errorString().c_str(), m_ecode);
+ }
+ } while(global && match && out.length() > off);
+
+ return out;
+}
+
+// -------------------------------------------------------------------
+std::vectorstd::string
+PosixRegEx::split(const std::string &str, bool empty, int eflags)
+{
+ if( !compiled)
+ {
+ BLOCXX_THROW(ca_mgm::ValueException,
+ "Regular expression is not compiled");
+ }
+
+ MatchArray rsub;
+ std::vectorstd::string ssub;
+ bool match;
+ size_t off = 0;
+ size_t len = str.length();
+
+ do
+ {
+ match = execute(rsub, str, off, 1, eflags);
+ if( match)
+ {
+ if( rsub.empty() ||
+ rsub[0].rm_so < 0 ||
+ rsub[0].rm_eo < 0)
+ {
+ BLOCXX_THROW(ca_mgm::ValueException,
+ "Non-capturing regular expression");
+ }
+
+ if( empty || ((size_t)rsub[0].rm_so > off))
+ {
+ ssub.push_back(str.substr(off,
+ rsub[0].rm_so - off));
+ }
+ off = rsub[0].rm_eo;
+ }
+ else if(m_ecode == REG_NOMATCH)
+ {
+ std::string tmp = str.substr(off);
+ if( empty || !tmp.empty())
+ {
+ ssub.push_back(tmp);
+ }
+ m_ecode = REG_NOERROR;
+ m_error.erase();
+ }
+ else
+ {
+ BLOCXX_THROW_ERR(ca_mgm::RuntimeException,
+ errorString().c_str(), m_ecode);
+ }
+ } while(match && len > off);
+
+ return ssub;
+}
+
+
+// -------------------------------------------------------------------
+std::vectorstd::string
+PosixRegEx::grep(const std::vectorstd::string &src, int eflags)
+{
+ if( !compiled)
+ {
+ BLOCXX_THROW(ca_mgm::ValueException,
+ "Regular expression is not compiled");
+ }
+
+ m_ecode = REG_NOERROR;
+ m_error.erase();
+
+ std::vectorstd::string out;
+ if( !src.empty())
+ {
+ std::vectorstd::string::const_iterator i=src.begin();
+ for( ; i != src.end(); ++i)
+ {
+ int ret = ::regexec(&m_regex, i->c_str(),
+ 0, NULL, eflags);
+ if( ret == REG_NOERROR)
+ {
+ out.push_back(*i);
+ }
+ else if(ret != REG_NOMATCH)
+ {
+ m_ecode = ret;
+ m_error = getError(&m_regex, m_ecode);
+ BLOCXX_THROW_ERR(ca_mgm::RuntimeException,
+ errorString().c_str(), m_ecode);
+ }
+ }
+ }
+
+ return out;
+}
+
+
+// -------------------------------------------------------------------
+bool
+PosixRegEx::match(const std::string &str, size_t index, int eflags) const
+{
+ if( !compiled)
+ {
+ BLOCXX_THROW(ca_mgm::ValueException,
+ "Regular expression is not compiled");
+ }
+
+ if( index > str.length())
+ {
+ BLOCXX_THROW(ca_mgm::OverflowException,
+ str::form("String index out of bounds ("
+ "length = %d, index = %d).",
+ str.length(), index
+ ).c_str());
+ }
+
+ m_ecode = ::regexec(&m_regex, str.c_str() + index,
+ 0, NULL, eflags);
+
+ if( m_ecode == REG_NOERROR)
+ {
+ m_error.erase();
+ return true;
+ }
+ else if(m_ecode == REG_NOMATCH)
+ {
+ m_error = getError(&m_regex, m_ecode);
+ return false;
+ }
+ else
+ {
+ m_error = getError(&m_regex, m_ecode);
+ BLOCXX_THROW_ERR(ca_mgm::RuntimeException,
+ errorString().c_str(), m_ecode);
+ }
+}
+
+
+// -------------------------------------------------------------------
+} // namespace BLOCXX_NAMESPACE
+
+/* vim: set ts=8 sts=8 sw=8 ai noet: */
+
Modified: limal-branches/mc-devel/limal-ca-mgm/src/RequestData.cpp
URL: http://svn.opensuse.org/viewcvs/limal/limal-branches/mc-devel/limal-ca-mgm/src/RequestData.cpp?rev=2675&r1=2674&r2=2675&view=diff
==============================================================================
--- limal-branches/mc-devel/limal-ca-mgm/src/RequestData.cpp (original)
+++ limal-branches/mc-devel/limal-ca-mgm/src/RequestData.cpp Sat Jul 3 13:27:18 2010
@@ -101,19 +101,19 @@
return m_impl->extensions;
}
-blocxx::String
+std::string
RequestData::getChallengePassword() const
{
return m_impl->challengePassword;
}
-blocxx::String
+std::string
RequestData::getUnstructuredName() const
{
return m_impl->unstructuredName;
}
-blocxx::String
+std::string
RequestData::getRequestAsText() const
{
unsigned char *ustringval = NULL;
@@ -123,13 +123,13 @@
X509_REQ_print_ex(bio, m_impl->x509, 0, 0);
n = BIO_get_mem_data(bio, &ustringval);
- String text = String((const char*)ustringval, n);
+ std::string text = std::string((const char*)ustringval, n);
BIO_free(bio);
return text;
}
-blocxx::String
+std::string
RequestData::getExtensionsAsText() const
{
unsigned char *ustringval = NULL;
@@ -139,7 +139,7 @@
X509V3_extensions_print(bio, NULL, X509_REQ_get_extensions(m_impl->x509), 0, 4);
n = BIO_get_mem_data(bio, &ustringval);
- String extText = String((const char*)ustringval, n);
+ std::string extText = std::string((const char*)ustringval, n);
BIO_free(bio);
return extText;
@@ -169,14 +169,14 @@
return true;
}
-std::vectorblocxx::String
+std::vectorstd::string
RequestData::verify() const
{
- std::vectorblocxx::String result;
+ std::vectorstd::string result;
if(m_impl->version < 1 || m_impl->version > 1)
{
- result.push_back(Format("invalid version: %1", m_impl->version).toString());
+ result.push_back(str::form("invalid version: %d", m_impl->version));
}
appendArray(result, m_impl->subject.verify());
@@ -195,34 +195,30 @@
return result;
}
-std::vectorblocxx::String
+std::vectorstd::string
RequestData::dump() const
{
- std::vectorblocxx::String result;
+ std::vectorstd::string result;
result.push_back("RequestData::dump()");
- result.push_back("Version = " + String(m_impl->version));
+ result.push_back("Version = " + str::numstring(m_impl->version));
appendArray(result, m_impl->subject.dump());
- result.push_back("Keysize = " + String(m_impl->keysize));
- result.push_back("pubkeyAlgorithm = " + String(m_impl->pubkeyAlgorithm));
+ result.push_back("Keysize = " + str::numstring(m_impl->keysize));
+ result.push_back("pubkeyAlgorithm = " + str::numstring(m_impl->pubkeyAlgorithm));
- String pk;
+ std::string pk;
for(size_t i = 0; i < m_impl->publicKey.size(); ++i)
{
- String s;
- s.format("%02x", static_cast<UInt8>(m_impl->publicKey[i]));
- pk += s + ":";
+ pk += str::form( "%02x", static_cast<UInt8>(m_impl->publicKey[i])) + ":";
}
result.push_back("public Key = " + pk);
- result.push_back("signatureAlgorithm = "+ String(m_impl->signatureAlgorithm));
+ result.push_back("signatureAlgorithm = "+ str::numstring(m_impl->signatureAlgorithm));
- String s;
+ std::string s;
for(uint i = 0; i < m_impl->signature.size(); ++i)
{
- String d;
- d.format("%02x:", static_cast<UInt8>(m_impl->signature[i]));
- s += d;
+ s += str::form( "%02x", static_cast<UInt8>(m_impl->signature[i]));
}
result.push_back("Signature = " + s);
Modified: limal-branches/mc-devel/limal-ca-mgm/src/RequestDataImpl.hpp
URL: http://svn.opensuse.org/viewcvs/limal/limal-branches/mc-devel/limal-ca-mgm/src/RequestDataImpl.hpp?rev=2675&r1=2674&r2=2675&view=diff
==============================================================================
--- limal-branches/mc-devel/limal-ca-mgm/src/RequestDataImpl.hpp (original)
+++ limal-branches/mc-devel/limal-ca-mgm/src/RequestDataImpl.hpp Sat Jul 3 13:27:18 2010
@@ -98,8 +98,8 @@
X509v3RequestExts extensions;
// attributes
- String challengePassword;
- String unstructuredName;
+ std::string challengePassword;
+ std::string unstructuredName;
X509_REQ *x509;
};
Modified: limal-branches/mc-devel/limal-ca-mgm/src/RequestData_Priv.cpp
URL: http://svn.opensuse.org/viewcvs/limal/limal-branches/mc-devel/limal-ca-mgm/src/RequestData_Priv.cpp?rev=2675&r1=2674&r2=2675&view=diff
==============================================================================
--- limal-branches/mc-devel/limal-ca-mgm/src/RequestData_Priv.cpp (original)
+++ limal-branches/mc-devel/limal-ca-mgm/src/RequestData_Priv.cpp Sat Jul 3 13:27:18 2010
@@ -57,7 +57,7 @@
init(request, formatType);
}
-RequestData_Priv::RequestData_Priv(const String& requestPath,
+RequestData_Priv::RequestData_Priv(const std::string& requestPath,
FormatType formatType)
: RequestData()
{
@@ -90,7 +90,7 @@
void
RequestData_Priv::setSubjectDN(const DNObject dn)
{
- std::vectorblocxx::String r = dn.verify();
+ std::vectorstd::string r = dn.verify();
if(!r.empty())
{
LOGIT_ERROR(r[0]);
@@ -126,7 +126,7 @@
void
RequestData_Priv::setExtensions(const X509v3RequestExts &ext)
{
- std::vectorblocxx::String r = ext.verify();
+ std::vectorstd::string r = ext.verify();
if(!r.empty())
{
LOGIT_ERROR(r[0]);
@@ -136,13 +136,13 @@
}
void
-RequestData_Priv::setChallengePassword(const String &passwd)
+RequestData_Priv::setChallengePassword(const std::string &passwd)
{
m_impl->challengePassword = passwd;
}
void
-RequestData_Priv::setUnstructuredName(const String &name)
+RequestData_Priv::setUnstructuredName(const std::string &name)
{
m_impl->unstructuredName = name;
}
@@ -249,18 +249,18 @@
i2a_ASN1_OBJECT(bio, x509->sig_alg->algorithm);
int n = BIO_get_mem_data(bio, &cbuf);
- String sbuf = String(cbuf, n);
+ std::string sbuf = std::string(cbuf, n);
BIO_free(bio);
- if(sbuf.equalsIgnoreCase("sha1WithRSAEncryption") )
+ if(0 == str::compareCI(sbuf, "sha1WithRSAEncryption") )
{
m_impl->signatureAlgorithm = E_SHA1RSA;
}
- else if(sbuf.equalsIgnoreCase("md5WithRSAEncryption") )
+ else if(0 == str::compareCI(sbuf, "md5WithRSAEncryption") )
{
m_impl->signatureAlgorithm = E_MD5RSA;
}
- else if(sbuf.equalsIgnoreCase("dsaWithSHA1") )
+ else if(0 == str::compareCI(sbuf, "dsaWithSHA1") )
{
m_impl->signatureAlgorithm = E_SHA1DSA;
}
@@ -270,7 +270,7 @@
LOGIT_ERROR("Unsupported signature algorithm: '" << sbuf << "'");
BLOCXX_THROW(ca_mgm::RuntimeException,
- Format(__("Unsupported signature algorithm %1."), sbuf).c_str());
+ str::form(__("Unsupported signature algorithm %s."), sbuf.c_str()).c_str());
}
// get signature
@@ -327,7 +327,7 @@
memcpy(d, bs->data, bs->length);
d[bs->length] = '\0';
- String s(d, bs->length);
+ std::string s(d, bs->length);
delete [] d;
if(nid == NID_pkcs9_challengePassword)
Modified: limal-branches/mc-devel/limal-ca-mgm/src/RequestData_Priv.hpp
URL: http://svn.opensuse.org/viewcvs/limal/limal-branches/mc-devel/limal-ca-mgm/src/RequestData_Priv.hpp?rev=2675&r1=2674&r2=2675&view=diff
==============================================================================
--- limal-branches/mc-devel/limal-ca-mgm/src/RequestData_Priv.hpp (original)
+++ limal-branches/mc-devel/limal-ca-mgm/src/RequestData_Priv.hpp Sat Jul 3 13:27:18 2010
@@ -35,7 +35,7 @@
class RequestData_Priv : public RequestData {
public:
RequestData_Priv();
- RequestData_Priv(const String& requestPath,
+ RequestData_Priv(const std::string& requestPath,
FormatType formatType = E_PEM);
RequestData_Priv(const ByteBuffer& request,
FormatType formatType = E_PEM);
@@ -50,8 +50,8 @@
void setSignatureAlgorithm(SigAlg alg);
void setSignature(const ByteBuffer &sig);
void setExtensions(const X509v3RequestExts &ext);
- void setChallengePassword(const String &passwd);
- void setUnstructuredName(const String &name);
+ void setChallengePassword(const std::string &passwd);
+ void setUnstructuredName(const std::string &name);
private:
Modified: limal-branches/mc-devel/limal-ca-mgm/src/RequestGenerationData.cpp
URL: http://svn.opensuse.org/viewcvs/limal/limal-branches/mc-devel/limal-ca-mgm/src/RequestGenerationData.cpp?rev=2675&r1=2674&r2=2675&view=diff
==============================================================================
--- limal-branches/mc-devel/limal-ca-mgm/src/RequestGenerationData.cpp (original)
+++ limal-branches/mc-devel/limal-ca-mgm/src/RequestGenerationData.cpp Sat Jul 3 13:27:18 2010
@@ -73,8 +73,8 @@
MD messageDigest; // parameter default_md
// attributes
- String challengePassword;
- String unstructuredName;
+ std::string challengePassword;
+ std::string unstructuredName;
X509v3RequestExts extensions;
@@ -90,18 +90,18 @@
{
m_impl->subject = DNObject(caConfig, type);
m_impl->extensions = X509v3RequestExts(caConfig, type);
- m_impl->keysize = caConfig->getValue(type2Section(type, false), "default_bits").toUInt32();
+ m_impl->keysize = str::strtonum(caConfig->getValue(type2Section(type, false), "default_bits"));
- String md = caConfig->getValue(type2Section(type, false), "default_md");
- if(md.equalsIgnoreCase("sha1"))
+ std::string md = caConfig->getValue(type2Section(type, false), "default_md");
+ if(0 == str::compareCI(md, "sha1"))
{
m_impl->messageDigest = E_SHA1;
}
- else if(md.equalsIgnoreCase("md5"))
+ else if(0 == str::compareCI(md, "md5"))
{
m_impl->messageDigest = E_MD5;
}
- else if(md.equalsIgnoreCase("mdc2"))
+ else if(0 == str::compareCI(md, "mdc2"))
{
m_impl->messageDigest = E_MDC2;
}
@@ -133,7 +133,7 @@
void
RequestGenerationData::setSubjectDN(const DNObject dn)
{
- std::vectorblocxx::String r = dn.verify();
+ std::vectorstd::string r = dn.verify();
if(!r.empty())
{
LOGIT_ERROR(r[0]);
@@ -179,24 +179,24 @@
}
void
-RequestGenerationData::setChallengePassword(const String &passwd)
+RequestGenerationData::setChallengePassword(const std::string &passwd)
{
m_impl->challengePassword = passwd;
}
-blocxx::String
+std::string
RequestGenerationData::getChallengePassword() const
{
return m_impl->challengePassword;
}
void
-RequestGenerationData::setUnstructuredName(const String &name)
+RequestGenerationData::setUnstructuredName(const std::string &name)
{
m_impl->unstructuredName = name;
}
-blocxx::String
+std::string
RequestGenerationData::getUnstructuredName() const
{
return m_impl->unstructuredName;
@@ -205,7 +205,7 @@
void
RequestGenerationData::setExtensions(const X509v3RequestExts &ext)
{
- std::vectorblocxx::String r = ext.verify();
+ std::vectorstd::string r = ext.verify();
if(!r.empty())
{
LOGIT_ERROR(r[0]);
@@ -243,12 +243,12 @@
{
LOGIT_ERROR("wrong type" << type);
BLOCXX_THROW(ca_mgm::ValueException,
- Format(__("Wrong type: %1."), type).c_str());
+ str::form(__("Wrong type: %1."), type).c_str());
}
- ca.getConfig()->setValue(type2Section(type, false), "default_bits", String(m_impl->keysize));
+ ca.getConfig()->setValue(type2Section(type, false), "default_bits", str::numstring(m_impl->keysize));
- String md("sha1");
+ std::string md("sha1");
switch(m_impl->messageDigest)
{
case E_SHA1:
@@ -276,10 +276,10 @@
return m_impl->extensions.valid();
}
-std::vectorblocxx::String
+std::vectorstd::string
RequestGenerationData::verify() const
{
- std::vectorblocxx::String result;
+ std::vectorstd::string result;
appendArray(result, m_impl->subject.verify());
@@ -292,15 +292,15 @@
return result;
}
-std::vectorblocxx::String
+std::vectorstd::string
RequestGenerationData::dump() const
{
- std::vectorblocxx::String result;
+ std::vectorstd::string result;
result.push_back("RequestGenerationData::dump()");
appendArray(result, m_impl->subject.dump());
- result.push_back("Keysize = " + String(m_impl->keysize));
- result.push_back("MessageDigest = " + String(m_impl->messageDigest));
+ result.push_back("Keysize = " + str::numstring(m_impl->keysize));
+ result.push_back("MessageDigest = " + str::numstring(m_impl->messageDigest));
result.push_back("Challenge Password = " + m_impl->challengePassword);
result.push_back("Unstructured Name = " + m_impl->unstructuredName);
appendArray(result, m_impl->extensions.dump());
Modified: limal-branches/mc-devel/limal-ca-mgm/src/String.cpp
URL: http://svn.opensuse.org/viewcvs/limal/limal-branches/mc-devel/limal-ca-mgm/src/String.cpp?rev=2675&r1=2674&r2=2675&view=diff
==============================================================================
--- limal-branches/mc-devel/limal-ca-mgm/src/String.cpp (original)
+++ limal-branches/mc-devel/limal-ca-mgm/src/String.cpp Sat Jul 3 13:27:18 2010
@@ -11,7 +11,7 @@
| (C) SUSE Linux Products GmbH |
\----------------------------------------------------------------------/
- File: String.cpp
+ File: std::string.cpp
Author: Michael Andres
Modified: limal-branches/mc-devel/limal-ca-mgm/src/StringExtensions.cpp
URL: http://svn.opensuse.org/viewcvs/limal/limal-branches/mc-devel/limal-ca-mgm/src/StringExtensions.cpp?rev=2675&r1=2674&r2=2675&view=diff
==============================================================================
--- limal-branches/mc-devel/limal-ca-mgm/src/StringExtensions.cpp (original)
+++ limal-branches/mc-devel/limal-ca-mgm/src/StringExtensions.cpp Sat Jul 3 13:27:18 2010
@@ -39,10 +39,10 @@
{
public:
StringExtensionImpl()
- : value(String())
+ : value(std::string())
{}
- StringExtensionImpl(const String &v)
+ StringExtensionImpl(const std::string &v)
: value(v)
{}
@@ -58,7 +58,7 @@
return new StringExtensionImpl(*this);
}
- String value;
+ std::string value;
};
@@ -73,7 +73,7 @@
// protected:
-StringExtension::StringExtension(const String &v )
+StringExtension::StringExtension(const std::string &v )
: ExtensionBase()
, m_impl(new StringExtensionImpl(v))
{}
@@ -97,7 +97,7 @@
// #################################################################
-NsBaseUrlExt::NsBaseUrlExt(const String &v)
+NsBaseUrlExt::NsBaseUrlExt(const std::string &v)
: StringExtension(v)
{
if(!initURICheck().isValid(v))
@@ -110,22 +110,22 @@
}
NsBaseUrlExt::NsBaseUrlExt(CAConfig* caConfig, Type type)
- : StringExtension(String())
+ : StringExtension(std::string())
{
// These types are not supported by this object
if(type == E_CRL)
{
LOGIT_ERROR("wrong type" << type);
BLOCXX_THROW(ca_mgm::ValueException,
- Format(__("Wrong type: %1."), type).c_str());
+ str::form(__("Wrong type: %1."), type).c_str());
}
bool p = caConfig->exists(type2Section(type, true), "nsBaseUrl");
if(p)
{
- std::vectorblocxx::String sp = convStringArray(PerlRegEx("\\s*,\\s*")
- .split(caConfig->getValue(type2Section(type, true), "nsBaseUrl")));
- if(sp[0].equalsIgnoreCase("critical"))
+ std::vectorstd::string sp = PerlRegEx("\\s*,\\s*")
+ .split(caConfig->getValue(type2Section(type, true), "nsBaseUrl"));
+ if(0 == str::compareCI(sp[0], "critical"))
{
setCritical(true);
m_impl->value = sp[1];
@@ -156,7 +156,7 @@
}
void
-NsBaseUrlExt::setValue(const String &v)
+NsBaseUrlExt::setValue(const std::string &v)
{
if(!initURICheck().isValid(v))
{
@@ -168,7 +168,7 @@
setPresent(true);
}
-blocxx::String
+std::string
NsBaseUrlExt::getValue() const
{
if(!isPresent())
@@ -194,12 +194,12 @@
{
LOGIT_ERROR("wrong type" << type);
BLOCXX_THROW(ca_mgm::ValueException,
- Format(__("Wrong type: %1."), type).c_str());
+ str::form(__("Wrong type: %1."), type).c_str());
}
if(isPresent())
{
- String extString;
+ std::string extString;
if(isCritical()) extString += "critical,";
extString += m_impl->value;
@@ -225,25 +225,25 @@
return true;
}
-std::vectorblocxx::String
+std::vectorstd::string
NsBaseUrlExt::verify() const
{
- std::vectorblocxx::String result;
+ std::vectorstd::string result;
if(!isPresent()) return result;
if(!initURICheck().isValid(m_impl->value)) {
LOGIT_DEBUG("Wrong value for NsBaseUrlExt:" << m_impl->value);
- result.push_back(Format("Wrong value for NsBaseUrlExt: %1", m_impl->value).toString());
+ result.push_back(str::form("Wrong value for NsBaseUrlExt: %s", m_impl->value.c_str()));
}
LOGIT_DEBUG_STRINGARRAY("NsBaseUrlExt::verify()", result);
return result;
}
-std::vectorblocxx::String
+std::vectorstd::string
NsBaseUrlExt::dump() const
{
- std::vectorblocxx::String result;
+ std::vectorstd::string result;
result.push_back("NsBaseUrlExt::dump()");
appendArray(result, ExtensionBase::dump());
@@ -257,13 +257,13 @@
// private:
NsBaseUrlExt::NsBaseUrlExt()
- : StringExtension(String())
+ : StringExtension(std::string())
{}
// #################################################################
-NsRevocationUrlExt::NsRevocationUrlExt(const String &v)
+NsRevocationUrlExt::NsRevocationUrlExt(const std::string &v)
: StringExtension(v)
{
if(!initURICheck().isValid(v)) {
@@ -275,21 +275,21 @@
}
NsRevocationUrlExt::NsRevocationUrlExt(CAConfig* caConfig, Type type)
- : StringExtension(String())
+ : StringExtension(std::string())
{
// These types are not supported by this object
if(type == E_CRL)
{
LOGIT_ERROR("wrong type" << type);
BLOCXX_THROW(ca_mgm::ValueException,
- Format(__("Wrong type: %1."), type).c_str());
+ str::form(__("Wrong type: %1."), type).c_str());
}
bool p = caConfig->exists(type2Section(type, true), "nsRevocationUrl");
if(p) {
- std::vectorblocxx::String sp = convStringArray(PerlRegEx("\\s*,\\s*")
- .split(caConfig->getValue(type2Section(type, true), "nsRevocationUrl")));
- if(sp[0].equalsIgnoreCase("critical")) {
+ std::vectorstd::string sp = PerlRegEx("\\s*,\\s*")
+ .split(caConfig->getValue(type2Section(type, true), "nsRevocationUrl"));
+ if(0 == str::compareCI(sp[0], "critical")) {
setCritical(true);
m_impl->value = sp[1];
} else {
@@ -317,7 +317,7 @@
}
void
-NsRevocationUrlExt::setValue(const String &v)
+NsRevocationUrlExt::setValue(const std::string &v)
{
if(!initURICheck().isValid(v)) {
LOGIT_ERROR("invalid value for NsRevocationUrlExt");
@@ -328,7 +328,7 @@
setPresent(true);
}
-blocxx::String
+std::string
NsRevocationUrlExt::getValue() const
{
if(!isPresent()) {
@@ -352,11 +352,11 @@
{
LOGIT_ERROR("wrong type" << type);
BLOCXX_THROW(ca_mgm::ValueException,
- Format(__("Wrong type: %1."), type).c_str());
+ str::form(__("Wrong type: %1."), type).c_str());
}
if(isPresent()) {
- String extString;
+ std::string extString;
if(isCritical()) extString += "critical,";
extString += m_impl->value;
@@ -367,16 +367,16 @@
}
}
-std::vectorblocxx::String
+std::vectorstd::string
NsRevocationUrlExt::verify() const
{
- std::vectorblocxx::String result;
+ std::vectorstd::string result;
if(!isPresent()) return result;
if(!initURICheck().isValid(m_impl->value)) {
LOGIT_DEBUG("Wrong value for NsRevocationUrlExt:" << m_impl->value);
- result.push_back(Format("Wrong value for NsRevocationUrlExt: %1", m_impl->value).toString());
+ result.push_back(str::form("Wrong value for NsRevocationUrlExt: %s", m_impl->value.c_str()));
}
LOGIT_DEBUG_STRINGARRAY("NsRevocationUrlExt::verify()", result);
return result;
@@ -394,10 +394,10 @@
return true;
}
-std::vectorblocxx::String
+std::vectorstd::string
NsRevocationUrlExt::dump() const
{
- std::vectorblocxx::String result;
+ std::vectorstd::string result;
result.push_back("NsRevocationUrlExt::dump()");
appendArray(result, ExtensionBase::dump());
@@ -410,14 +410,14 @@
// private:
NsRevocationUrlExt::NsRevocationUrlExt()
- : StringExtension(String())
+ : StringExtension(std::string())
{
}
// #################################################################
-NsCaRevocationUrlExt::NsCaRevocationUrlExt(const String &v)
+NsCaRevocationUrlExt::NsCaRevocationUrlExt(const std::string &v)
: StringExtension(v)
{
if(!initURICheck().isValid(v)) {
@@ -429,21 +429,21 @@
}
NsCaRevocationUrlExt::NsCaRevocationUrlExt(CAConfig* caConfig, Type type)
- : StringExtension(String())
+ : StringExtension(std::string())
{
// These types are not supported by this object
if(type == E_CRL)
{
LOGIT_ERROR("wrong type" << type);
BLOCXX_THROW(ca_mgm::ValueException,
- Format(__("Wrong type: %1."), type).c_str());
+ str::form(__("Wrong type: %1."), type).c_str());
}
bool p = caConfig->exists(type2Section(type, true), "nsCaRevocationUrl");
if(p) {
- std::vectorblocxx::String sp = convStringArray(PerlRegEx("\\s*,\\s*")
- .split(caConfig->getValue(type2Section(type, true), "nsCaRevocationUrl")));
- if(sp[0].equalsIgnoreCase("critical")) {
+ std::vectorstd::string sp = PerlRegEx("\\s*,\\s*")
+ .split(caConfig->getValue(type2Section(type, true), "nsCaRevocationUrl"));
+ if(0 == str::compareCI(sp[0], "critical")) {
setCritical(true);
m_impl->value = sp[1];
} else {
@@ -471,7 +471,7 @@
}
void
-NsCaRevocationUrlExt::setValue(const String &v)
+NsCaRevocationUrlExt::setValue(const std::string &v)
{
if(!initURICheck().isValid(v)) {
LOGIT_ERROR("invalid value for NsCaRevocationUrlExt");
@@ -482,7 +482,7 @@
setPresent(true);
}
-blocxx::String
+std::string
NsCaRevocationUrlExt::getValue() const
{
if(!isPresent()) {
@@ -506,11 +506,11 @@
{
LOGIT_ERROR("wrong type" << type);
BLOCXX_THROW(ca_mgm::ValueException,
- Format(__("Wrong type: %1."), type).c_str());
+ str::form(__("Wrong type: %1."), type).c_str());
}
if(isPresent()) {
- String extString;
+ std::string extString;
if(isCritical()) extString += "critical,";
extString += m_impl->value;
@@ -521,16 +521,16 @@
}
}
-std::vectorblocxx::String
+std::vectorstd::string
NsCaRevocationUrlExt::verify() const
{
- std::vectorblocxx::String result;
+ std::vectorstd::string result;
if(!isPresent()) return result;
if(!initURICheck().isValid(m_impl->value)) {
LOGIT_DEBUG("Wrong value for NsCaRevocationUrlExt:" << m_impl->value);
- result.push_back(Format("Wrong value for NsCaRevocationUrlExt: %1", m_impl->value).toString());
+ result.push_back(str::form("Wrong value for NsCaRevocationUrlExt: %s", m_impl->value.c_str()));
}
LOGIT_DEBUG_STRINGARRAY("NsCaRevocationUrlExt::verify()", result);
return result;
@@ -548,10 +548,10 @@
return true;
}
-std::vectorblocxx::String
+std::vectorstd::string
NsCaRevocationUrlExt::dump() const
{
- std::vectorblocxx::String result;
+ std::vectorstd::string result;
result.push_back("NsCaRevocationUrlExt::dump()");
appendArray(result, ExtensionBase::dump());
@@ -564,13 +564,13 @@
// private:
NsCaRevocationUrlExt::NsCaRevocationUrlExt()
- : StringExtension(String())
+ : StringExtension(std::string())
{}
// #################################################################
-NsRenewalUrlExt::NsRenewalUrlExt(const String &v)
+NsRenewalUrlExt::NsRenewalUrlExt(const std::string &v)
: StringExtension(v)
{
if(!initURICheck().isValid(v)) {
@@ -582,21 +582,21 @@
}
NsRenewalUrlExt::NsRenewalUrlExt(CAConfig* caConfig, Type type)
- : StringExtension(String())
+ : StringExtension(std::string())
{
// These types are not supported by this object
if(type == E_CRL)
{
LOGIT_ERROR("wrong type" << type);
BLOCXX_THROW(ca_mgm::ValueException,
- Format(__("Wrong type: %1."), type).c_str());
+ str::form(__("Wrong type: %1."), type).c_str());
}
bool p = caConfig->exists(type2Section(type, true), "nsRenewalUrl");
if(p) {
- std::vectorblocxx::String sp = convStringArray(PerlRegEx("\\s*,\\s*")
- .split(caConfig->getValue(type2Section(type, true), "nsRenewalUrl")));
- if(sp[0].equalsIgnoreCase("critical")) {
+ std::vectorstd::string sp = PerlRegEx("\\s*,\\s*")
+ .split(caConfig->getValue(type2Section(type, true), "nsRenewalUrl"));
+ if(0 == str::compareCI(sp[0], "critical")) {
setCritical(true);
m_impl->value = sp[1];
} else {
@@ -624,7 +624,7 @@
}
void
-NsRenewalUrlExt::setValue(const String &v)
+NsRenewalUrlExt::setValue(const std::string &v)
{
if(!initURICheck().isValid(v)) {
LOGIT_ERROR("invalid value for NsRenewalUrlExt");
@@ -635,7 +635,7 @@
setPresent(true);
}
-blocxx::String
+std::string
NsRenewalUrlExt::getValue() const
{
if(!isPresent()) {
@@ -659,11 +659,11 @@
{
LOGIT_ERROR("wrong type" << type);
BLOCXX_THROW(ca_mgm::ValueException,
- Format(__("Wrong type: %1."), type).c_str());
+ str::form(__("Wrong type: %1."), type).c_str());
}
if(isPresent()) {
- String extString;
+ std::string extString;
if(isCritical()) extString += "critical,";
extString += m_impl->value;
@@ -674,16 +674,16 @@
}
}
-std::vectorblocxx::String
+std::vectorstd::string
NsRenewalUrlExt::verify() const
{
- std::vectorblocxx::String result;
+ std::vectorstd::string result;
if(!isPresent()) return result;
if(!initURICheck().isValid(m_impl->value)) {
LOGIT_DEBUG("Wrong value for NsRenewalUrlExt:" << m_impl->value);
- result.push_back(Format("Wrong value for NsRenewalUrlExt: %1", m_impl->value).toString());
+ result.push_back(str::form("Wrong value for NsRenewalUrlExt: %s", m_impl->value.c_str()));
}
LOGIT_DEBUG_STRINGARRAY("NsRenewalUrlExt::verify()", result);
return result;
@@ -701,10 +701,10 @@
return true;
}
-std::vectorblocxx::String
+std::vectorstd::string
NsRenewalUrlExt::dump() const
{
- std::vectorblocxx::String result;
+ std::vectorstd::string result;
result.push_back("NsRenewalUrlExt::dump()");
appendArray(result, ExtensionBase::dump());
@@ -717,12 +717,12 @@
// private:
NsRenewalUrlExt::NsRenewalUrlExt()
- : StringExtension(String())
+ : StringExtension(std::string())
{}
// #################################################################
-NsCaPolicyUrlExt::NsCaPolicyUrlExt(const String &v)
+NsCaPolicyUrlExt::NsCaPolicyUrlExt(const std::string &v)
: StringExtension(v)
{
if(!initURICheck().isValid(v)) {
@@ -734,21 +734,21 @@
}
NsCaPolicyUrlExt::NsCaPolicyUrlExt(CAConfig* caConfig, Type type)
- : StringExtension(String())
+ : StringExtension(std::string())
{
// These types are not supported by this object
if(type == E_CRL)
{
LOGIT_ERROR("wrong type" << type);
BLOCXX_THROW(ca_mgm::ValueException,
- Format(__("Wrong type: %1."), type).c_str());
+ str::form(__("Wrong type: %1."), type).c_str());
}
bool p = caConfig->exists(type2Section(type, true), "nsCaPolicyUrl");
if(p) {
- std::vectorblocxx::String sp = convStringArray(PerlRegEx("\\s*,\\s*")
- .split(caConfig->getValue(type2Section(type, true), "nsCaPolicyUrl")));
- if(sp[0].equalsIgnoreCase("critical")) {
+ std::vectorstd::string sp = PerlRegEx("\\s*,\\s*")
+ .split(caConfig->getValue(type2Section(type, true), "nsCaPolicyUrl"));
+ if(0 == str::compareCI(sp[0], "critical")) {
setCritical(true);
m_impl->value = sp[1];
} else {
@@ -776,7 +776,7 @@
}
void
-NsCaPolicyUrlExt::setValue(const String &v)
+NsCaPolicyUrlExt::setValue(const std::string &v)
{
if(!initURICheck().isValid(v)) {
LOGIT_ERROR("invalid value for NsCaPolicyUrlExt");
@@ -787,7 +787,7 @@
setPresent(true);
}
-blocxx::String
+std::string
NsCaPolicyUrlExt::getValue() const
{
if(!isPresent()) {
@@ -811,11 +811,11 @@
{
LOGIT_ERROR("wrong type" << type);
BLOCXX_THROW(ca_mgm::ValueException,
- Format(__("Wrong type: %1."), type).c_str());
+ str::form(__("Wrong type: %1."), type).c_str());
}
if(isPresent()) {
- String extString;
+ std::string extString;
if(isCritical()) extString += "critical,";
extString += m_impl->value;
@@ -826,16 +826,16 @@
}
}
-std::vectorblocxx::String
+std::vectorstd::string
NsCaPolicyUrlExt::verify() const
{
- std::vectorblocxx::String result;
+ std::vectorstd::string result;
if(!isPresent()) return result;
if(!initURICheck().isValid(m_impl->value)) {
LOGIT_DEBUG("Wrong value for NsCaPolicyUrlExt:" << m_impl->value);
- result.push_back(Format("Wrong value for NsCaPolicyUrlExt: %1", m_impl->value).toString());
+ result.push_back(str::form("Wrong value for NsCaPolicyUrlExt: %s", m_impl->value.c_str()));
}
LOGIT_DEBUG_STRINGARRAY("NsCaPolicyUrlExt::verify()", result);
return result;
@@ -853,10 +853,10 @@
return true;
}
-std::vectorblocxx::String
+std::vectorstd::string
NsCaPolicyUrlExt::dump() const
{
- std::vectorblocxx::String result;
+ std::vectorstd::string result;
result.push_back("NsCaPolicyUrlExt::dump()");
appendArray(result, ExtensionBase::dump());
@@ -869,34 +869,34 @@
// private:
NsCaPolicyUrlExt::NsCaPolicyUrlExt()
- : StringExtension(String())
+ : StringExtension(std::string())
{}
// #################################################################
-NsSslServerNameExt::NsSslServerNameExt(const String &v)
+NsSslServerNameExt::NsSslServerNameExt(const std::string &v)
: StringExtension(v)
{
setPresent(true);
}
NsSslServerNameExt::NsSslServerNameExt(CAConfig* caConfig, Type type)
- : StringExtension(String())
+ : StringExtension(std::string())
{
// These types are not supported by this object
if(type == E_CRL)
{
LOGIT_ERROR("wrong type" << type);
BLOCXX_THROW(ca_mgm::ValueException,
- Format(__("Invalid type: %1."), type).c_str());
+ str::form(__("Invalid type: %1."), type).c_str());
}
bool p = caConfig->exists(type2Section(type, true), "nsSslServerName");
if(p) {
- std::vectorblocxx::String sp = convStringArray(PerlRegEx("\\s*,\\s*")
- .split(caConfig->getValue(type2Section(type, true), "nsSslServerName")));
- if(sp[0].equalsIgnoreCase("critical")) {
+ std::vectorstd::string sp = PerlRegEx("\\s*,\\s*")
+ .split(caConfig->getValue(type2Section(type, true), "nsSslServerName"));
+ if(0 == str::compareCI(sp[0], "critical")) {
setCritical(true);
m_impl->value = sp[1];
} else {
@@ -924,13 +924,13 @@
}
void
-NsSslServerNameExt::setValue(const String &v)
+NsSslServerNameExt::setValue(const std::string &v)
{
m_impl->value = v;
setPresent(true);
}
-blocxx::String
+std::string
NsSslServerNameExt::getValue() const
{
if(!isPresent()) {
@@ -953,11 +953,11 @@
if(type == E_CRL) {
LOGIT_ERROR("wrong type" << type);
BLOCXX_THROW(ca_mgm::ValueException,
- Format(__("Wrong type: %1."), type).c_str());
+ str::form(__("Wrong type: %1."), type).c_str());
}
if(isPresent()) {
- String extString;
+ std::string extString;
if(isCritical()) extString += "critical,";
extString += m_impl->value;
@@ -968,10 +968,10 @@
}
}
-std::vectorblocxx::String
+std::vectorstd::string
NsSslServerNameExt::verify() const
{
- return std::vectorblocxx::String();
+ return std::vectorstd::string();
}
bool
@@ -980,10 +980,10 @@
return true;
}
-std::vectorblocxx::String
+std::vectorstd::string
NsSslServerNameExt::dump() const
{
- std::vectorblocxx::String result;
+ std::vectorstd::string result;
result.push_back("NsSslServerNameExt::dump()");
appendArray(result, ExtensionBase::dump());
@@ -997,32 +997,32 @@
// private:
NsSslServerNameExt::NsSslServerNameExt()
- : StringExtension(String())
+ : StringExtension(std::string())
{}
// #################################################################
-NsCommentExt::NsCommentExt(const String &v)
+NsCommentExt::NsCommentExt(const std::string &v)
: StringExtension(v)
{
setPresent(true);
}
NsCommentExt::NsCommentExt(CAConfig* caConfig, Type type)
- : StringExtension(String())
+ : StringExtension(std::string())
{
// These types are not supported by this object
if(type == E_CRL) {
LOGIT_ERROR("wrong type" << type);
BLOCXX_THROW(ca_mgm::ValueException,
- Format(__("Wrong type: %1."), type).c_str());
+ str::form(__("Wrong type: %1."), type).c_str());
}
bool p = caConfig->exists(type2Section(type, true), "nsComment");
if(p) {
- std::vectorblocxx::String sp = convStringArray(PerlRegEx("\\s*,\\s*")
- .split(caConfig->getValue(type2Section(type, true), "nsComment")));
- if(sp[0].equalsIgnoreCase("critical")) {
+ std::vectorstd::string sp = PerlRegEx("\\s*,\\s*")
+ .split(caConfig->getValue(type2Section(type, true), "nsComment"));
+ if(0 == str::compareCI(sp[0], "critical")) {
setCritical(true);
m_impl->value = sp[1];
} else {
@@ -1050,13 +1050,13 @@
}
void
-NsCommentExt::setValue(const String &v)
+NsCommentExt::setValue(const std::string &v)
{
m_impl->value = v;
setPresent(true);
}
-blocxx::String
+std::string
NsCommentExt::getValue() const
{
if(!isPresent()) {
@@ -1079,11 +1079,11 @@
if(type == E_CRL) {
LOGIT_ERROR("wrong type" << type);
BLOCXX_THROW(ca_mgm::ValueException,
- Format(__("Wrong type: %1."), type).c_str());
+ str::form(__("Wrong type: %1."), type).c_str());
}
if(isPresent()) {
- String extString;
+ std::string extString;
if(isCritical()) extString += "critical,";
extString += m_impl->value;
@@ -1094,10 +1094,10 @@
}
}
-std::vectorblocxx::String
+std::vectorstd::string
NsCommentExt::verify() const
{
- return std::vectorblocxx::String();
+ return std::vectorstd::string();
}
bool
@@ -1106,10 +1106,10 @@
return true;
}
-std::vectorblocxx::String
+std::vectorstd::string
NsCommentExt::dump() const
{
- std::vectorblocxx::String result;
+ std::vectorstd::string result;
result.push_back("NsCommentExt::dump()");
appendArray(result, ExtensionBase::dump());
@@ -1122,7 +1122,7 @@
// private:
NsCommentExt::NsCommentExt()
- : StringExtension(String())
+ : StringExtension(std::string())
{}
}
Modified: limal-branches/mc-devel/limal-ca-mgm/src/SubjectAlternativeNameExtension.cpp
URL: http://svn.opensuse.org/viewcvs/limal/limal-branches/mc-devel/limal-ca-mgm/src/SubjectAlternativeNameExtension.cpp?rev=2675&r1=2674&r2=2675&view=diff
==============================================================================
--- limal-branches/mc-devel/limal-ca-mgm/src/SubjectAlternativeNameExtension.cpp (original)
+++ limal-branches/mc-devel/limal-ca-mgm/src/SubjectAlternativeNameExtension.cpp Sat Jul 3 13:27:18 2010
@@ -80,23 +80,23 @@
{
LOGIT_ERROR("wrong type" << type);
BLOCXX_THROW(ca_mgm::ValueException,
- Format(__("Wrong type: %1."), type).c_str());
+ str::form(__("Wrong type: %1."), type).c_str());
}
bool p = caConfig->exists(type2Section(type, true), "subjectAltName");
if(p)
{
- std::vectorblocxx::String sp = convStringArray(PerlRegEx("\\s*,\\s*")
- .split(caConfig->getValue(type2Section(type, true), "subjectAltName")));
+ std::vectorstd::string sp = PerlRegEx("\\s*,\\s*")
+ .split(caConfig->getValue(type2Section(type, true), "subjectAltName"));
- if(sp[0].equalsIgnoreCase("critical")) setCritical(true);
+ if(0 == str::compareCI(sp[0], "critical")) setCritical(true);
- std::vectorblocxx::String::const_iterator it = sp.begin();
+ std::vectorstd::string::const_iterator it = sp.begin();
for(; it != sp.end(); ++it)
{
- if((*it).indexOf(":") != String::npos)
+ if((*it).find_first_of(":") != std::string::npos)
{
- if((*it).equalsIgnoreCase("email:copy"))
+ if(0 == str::compareCI(*it, "email:copy"))
m_impl->emailCopy = true;
else
{
@@ -121,7 +121,7 @@
: ExtensionBase()
, m_impl(new SubjectAlternativeNameExtImpl(copyEmail, alternativeNameList))
{
- std::vectorblocxx::String r = checkLiteralValueList(alternativeNameList);
+ std::vectorstd::string r = checkLiteralValueList(alternativeNameList);
if(!r.empty())
{
LOGIT_ERROR(r[0]);
@@ -162,7 +162,7 @@
void
SubjectAlternativeNameExt::setAlternativeNameList(const std::list<LiteralValue> &alternativeNameList)
{
- std::vectorblocxx::String r = checkLiteralValueList(alternativeNameList);
+ std::vectorstd::string r = checkLiteralValueList(alternativeNameList);
if(!r.empty())
{
LOGIT_ERROR(r[0]);
@@ -210,17 +210,17 @@
{
LOGIT_ERROR("wrong type" << type);
BLOCXX_THROW(ca_mgm::ValueException,
- Format(__("Wrong type: %1."), type).c_str());
+ str::form(__("Wrong type: %1."), type).c_str());
}
if(isPresent())
{
- String extString;
+ std::string extString;
if(isCritical()) extString += "critical,";
if(m_impl->emailCopy) extString += "email:copy,";
- String val;
+ std::string val;
std::list<LiteralValue>::const_iterator it = m_impl->altNameList.begin();
for(int j = 0;it != m_impl->altNameList.end(); ++it, ++j)
{
@@ -250,7 +250,7 @@
LOGIT_DEBUG("return SubjectAlternativeNameExt::::valid() is false");
return false;
}
- std::vectorblocxx::String r = checkLiteralValueList(m_impl->altNameList);
+ std::vectorstd::string r = checkLiteralValueList(m_impl->altNameList);
if(!r.empty())
{
LOGIT_DEBUG(r[0]);
@@ -259,16 +259,16 @@
return true;
}
-std::vectorblocxx::String
+std::vectorstd::string
SubjectAlternativeNameExt::verify() const
{
- std::vectorblocxx::String result;
+ std::vectorstd::string result;
if(!isPresent()) return result;
if(!m_impl->emailCopy && m_impl->altNameList.empty())
{
- result.push_back(String("invalid value for SubjectAlternativeNameExt"));
+ result.push_back(std::string("invalid value for SubjectAlternativeNameExt"));
}
appendArray(result, checkLiteralValueList(m_impl->altNameList));
@@ -277,16 +277,16 @@
return result;
}
-std::vectorblocxx::String
+std::vectorstd::string
SubjectAlternativeNameExt::dump() const
{
- std::vectorblocxx::String result;
+ std::vectorstd::string result;
result.push_back("SubjectAlternativeNameExt::dump()");
appendArray(result, ExtensionBase::dump());
if(!isPresent()) return result;
- result.push_back("email:copy = " + Bool(m_impl->emailCopy).toString());
+ result.push_back("email:copy = " + str::toString(m_impl->emailCopy));
std::list< LiteralValue >::const_iterator it = m_impl->altNameList.begin();
for(; it != m_impl->altNameList.end(); ++it)
Modified: limal-branches/mc-devel/limal-ca-mgm/src/SubjectKeyIdentifierExtension.cpp
URL: http://svn.opensuse.org/viewcvs/limal/limal-branches/mc-devel/limal-ca-mgm/src/SubjectKeyIdentifierExtension.cpp?rev=2675&r1=2674&r2=2675&view=diff
==============================================================================
--- limal-branches/mc-devel/limal-ca-mgm/src/SubjectKeyIdentifierExtension.cpp (original)
+++ limal-branches/mc-devel/limal-ca-mgm/src/SubjectKeyIdentifierExtension.cpp Sat Jul 3 13:27:18 2010
@@ -40,10 +40,10 @@
public:
SubjectKeyIdentifierExtImpl()
: autodetect(false)
- , keyid(String())
+ , keyid(std::string())
{}
- SubjectKeyIdentifierExtImpl(bool autoDetect, const String& keyID)
+ SubjectKeyIdentifierExtImpl(bool autoDetect, const std::string& keyID)
: autodetect(autoDetect)
, keyid(keyID)
{}
@@ -62,7 +62,7 @@
}
bool autodetect; // ??
- String keyid;
+ std::string keyid;
};
@@ -80,18 +80,18 @@
{
LOGIT_ERROR("wrong type" << type);
BLOCXX_THROW(ca_mgm::ValueException,
- Format(__("Wrong type: %1."), type).c_str());
+ str::form(__("Wrong type: %1."), type).c_str());
}
bool p = caConfig->exists(type2Section(type, true), "subjectKeyIdentifier");
if(p)
{
- String str;
+ std::string str;
- std::vectorblocxx::String sp = convStringArray(PerlRegEx("\\s*,\\s*")
- .split(caConfig->getValue(type2Section(type, true), "subjectKeyIdentifier")));
+ std::vectorstd::string sp = PerlRegEx("\\s*,\\s*")
+ .split(caConfig->getValue(type2Section(type, true), "subjectKeyIdentifier"));
- if(sp[0].equalsIgnoreCase("critical"))
+ if(0 == str::compareCI(sp[0], "critical"))
{
setCritical(true);
str = sp[1];
@@ -101,10 +101,10 @@
str = sp[0];
}
- if(str.equalsIgnoreCase("hash"))
+ if(0 == str::compareCI(str, "hash"))
{
m_impl->autodetect = true;
- m_impl->keyid = String();
+ m_impl->keyid = std::string();
}
else
{
@@ -115,7 +115,7 @@
setPresent(p);
}
-SubjectKeyIdentifierExt::SubjectKeyIdentifierExt(bool autoDetect, const String& keyid)
+SubjectKeyIdentifierExt::SubjectKeyIdentifierExt(bool autoDetect, const std::string& keyid)
: ExtensionBase()
, m_impl(new SubjectKeyIdentifierExtImpl(autoDetect, keyid))
{
@@ -152,7 +152,7 @@
void
SubjectKeyIdentifierExt::setSubjectKeyIdentifier(bool autoDetect,
- const String& keyId)
+ const std::string& keyId)
{
if(!keyId.empty() && !initHexCheck().isValid(keyId))
{
@@ -176,7 +176,7 @@
return m_impl->autodetect;
}
-blocxx::String
+std::string
SubjectKeyIdentifierExt::getKeyID() const
{
if(!isPresent())
@@ -203,12 +203,12 @@
{
LOGIT_ERROR("wrong type" << type);
BLOCXX_THROW(ca_mgm::ValueException,
- Format(__("Wrong type: %1."), type).c_str());
+ str::form(__("Wrong type: %1."), type).c_str());
}
if(isPresent())
{
- String extString;
+ std::string extString;
if(isCritical()) extString += "critical,";
if(m_impl->autodetect) extString += "hash";
@@ -231,17 +231,17 @@
if(!m_impl->autodetect && m_impl->keyid.empty())
{
- LOGIT_DEBUG(String("Wrong value for SubjectKeyIdentifierExt: ") +
- Format("autodetect(%1), keyId(%2)",
- m_impl->autodetect?"true":"false", m_impl->keyid));
+ LOGIT_DEBUG(std::string("Wrong value for SubjectKeyIdentifierExt: ") +
+ str::form("autodetect(%s), keyId(%s)",
+ m_impl->autodetect?"true":"false", m_impl->keyid.c_str()));
return false;
}
if(m_impl->autodetect && !m_impl->keyid.empty())
{
- LOGIT_DEBUG(String("Wrong value for SubjectKeyIdentifierExt: ") +
- Format("autodetect(%1), keyId(%2)",
- m_impl->autodetect?"true":"false", m_impl->keyid));
+ LOGIT_DEBUG(std::string("Wrong value for SubjectKeyIdentifierExt: ") +
+ str::form("autodetect(%s), keyId(%s)",
+ m_impl->autodetect?"true":"false", m_impl->keyid.c_str()));
return false;
}
if(!m_impl->keyid.empty())
@@ -256,51 +256,51 @@
return true;
}
-std::vectorblocxx::String
+std::vectorstd::string
SubjectKeyIdentifierExt::verify() const
{
- std::vectorblocxx::String result;
+ std::vectorstd::string result;
if(!isPresent()) return result;
if(!m_impl->autodetect && m_impl->keyid.empty())
{
- result.push_back(String("Wrong value for SubjectKeyIdentifierExt: ") +
- Format("autodetect(%1), keyId(%2)",
+ result.push_back(std::string("Wrong value for SubjectKeyIdentifierExt: ") +
+ str::form("autodetect(%s), keyId(%s)",
m_impl->autodetect?"true":"false",
- m_impl->keyid.c_str()).toString());
+ m_impl->keyid.c_str()));
}
if(m_impl->autodetect && !m_impl->keyid.empty())
{
- result.push_back(String("Wrong value for SubjectKeyIdentifierExt: ") +
- Format("autodetect(%1), keyId(%2)",
+ result.push_back(std::string("Wrong value for SubjectKeyIdentifierExt: ") +
+ str::form("autodetect(%s), keyId(%s)",
m_impl->autodetect?"true":"false",
- m_impl->keyid.c_str()).toString());
+ m_impl->keyid.c_str()));
}
if(!m_impl->keyid.empty())
{
ValueCheck check = initHexCheck();
if(!check.isValid(m_impl->keyid))
{
- result.push_back(Format("Wrong keyID in SubjectKeyIdentifierExt: %1",
- m_impl->keyid.c_str()).toString());
+ result.push_back(str::form("Wrong keyID in SubjectKeyIdentifierExt: %s",
+ m_impl->keyid.c_str()));
}
}
LOGIT_DEBUG_STRINGARRAY("SubjectKeyIdentifierExt::verify()", result);
return result;
}
-std::vectorblocxx::String
+std::vectorstd::string
SubjectKeyIdentifierExt::dump() const
{
- std::vectorblocxx::String result;
+ std::vectorstd::string result;
result.push_back("SubjectKeyIdentifierExt::dump()");
appendArray(result, ExtensionBase::dump());
if(!isPresent()) return result;
- result.push_back("Autodetect = " + Bool(m_impl->autodetect).toString());
+ result.push_back("Autodetect = " + str::toString(m_impl->autodetect));
result.push_back("KeyID = " + m_impl->keyid);
return result;
Modified: limal-branches/mc-devel/limal-ca-mgm/src/Url.cpp
URL: http://svn.opensuse.org/viewcvs/limal/limal-branches/mc-devel/limal-ca-mgm/src/Url.cpp?rev=2675&r1=2674&r2=2675&view=diff
==============================================================================
--- limal-branches/mc-devel/limal-ca-mgm/src/Url.cpp (original)
+++ limal-branches/mc-devel/limal-ca-mgm/src/Url.cpp Sat Jul 3 13:27:18 2010
@@ -68,7 +68,7 @@
// -----------------------------------------------------------------
-Url::Url(const blocxx::String &urlString)
+Url::Url(const std::string &urlString)
: m_impl( parseUrl(urlString))
{
}
@@ -76,7 +76,7 @@
// -----------------------------------------------------------------
Url&
-Url::operator = (const blocxx::String &urlString)
+Url::operator = (const std::string &urlString)
{
UrlRef url( parseUrl(urlString));
if( !url)
@@ -102,7 +102,7 @@
// -----------------------------------------------------------------
// static
UrlRef
-Url::parseUrl(const blocxx::String &urlString)
+Url::parseUrl(const std::string &urlString)
{
try
{
@@ -135,7 +135,7 @@
// -----------------------------------------------------------------
-std::vectorblocxx::String
+std::vectorstd::string
Url::getKnownSchemes() const
{
return m_impl->getKnownSchemes();
@@ -144,7 +144,7 @@
// -----------------------------------------------------------------
bool
-Url::isValidScheme(const blocxx::String &scheme) const
+Url::isValidScheme(const std::string &scheme) const
{
return m_impl->isValidScheme(scheme);
}
@@ -159,7 +159,7 @@
// -----------------------------------------------------------------
-blocxx::String
+std::string
Url::toString() const
{
return m_impl->toString();
@@ -167,7 +167,7 @@
// -----------------------------------------------------------------
-blocxx::String
+std::string
Url::toCompleteString() const
{
// make sure, all url components are included;
@@ -187,7 +187,7 @@
// -----------------------------------------------------------------
-blocxx::String
+std::string
Url::toString(const ViewOptions &opts) const
{
return m_impl->toString(opts);
@@ -195,7 +195,7 @@
// -----------------------------------------------------------------
-blocxx::String
+std::string
Url::getScheme() const
{
return m_impl->getScheme();
@@ -203,14 +203,14 @@
// -----------------------------------------------------------------
-blocxx::String
+std::string
Url::getAuthority() const
{
return m_impl->getAuthority();
}
// -----------------------------------------------------------------
-blocxx::String
+std::string
Url::getPathData() const
{
return m_impl->getPathData();
@@ -218,7 +218,7 @@
// -----------------------------------------------------------------
-blocxx::String
+std::string
Url::getQueryString() const
{
return m_impl->getQueryString();
@@ -226,7 +226,7 @@
// -----------------------------------------------------------------
-blocxx::String
+std::string
Url::getFragment(ca_mgm::url::EEncoding eflag) const
{
return m_impl->getFragment(eflag);
@@ -234,7 +234,7 @@
// -----------------------------------------------------------------
-blocxx::String
+std::string
Url::getUsername(EEncoding eflag) const
{
return m_impl->getUsername(eflag);
@@ -242,7 +242,7 @@
// -----------------------------------------------------------------
-blocxx::String
+std::string
Url::getPassword(EEncoding eflag) const
{
return m_impl->getPassword(eflag);
@@ -250,7 +250,7 @@
// -----------------------------------------------------------------
-blocxx::String
+std::string
Url::getHost(EEncoding eflag) const
{
return m_impl->getHost(eflag);
@@ -258,7 +258,7 @@
// -----------------------------------------------------------------
-blocxx::String
+std::string
Url::getPort() const
{
return m_impl->getPort();
@@ -266,7 +266,7 @@
// -----------------------------------------------------------------
-blocxx::String
+std::string
Url::getPathName(EEncoding eflag) const
{
return m_impl->getPathName(eflag);
@@ -274,7 +274,7 @@
// -----------------------------------------------------------------
-blocxx::String
+std::string
Url::getPathParams() const
{
return m_impl->getPathParams();
@@ -282,7 +282,7 @@
// -----------------------------------------------------------------
-std::vectorblocxx::String
+std::vectorstd::string
Url::getPathParamsArray() const
{
return m_impl->getPathParamsArray();
@@ -298,15 +298,15 @@
// -----------------------------------------------------------------
-blocxx::String
-Url::getPathParam(const blocxx::String ¶m, EEncoding eflag) const
+std::string
+Url::getPathParam(const std::string ¶m, EEncoding eflag) const
{
return m_impl->getPathParam(param, eflag);
}
// -----------------------------------------------------------------
-std::vectorblocxx::String
+std::vectorstd::string
Url::getQueryStringArray() const
{
return m_impl->getQueryStringArray();
@@ -322,8 +322,8 @@
// -----------------------------------------------------------------
-blocxx::String
-Url::getQueryParam(const blocxx::String ¶m, EEncoding eflag) const
+std::string
+Url::getQueryParam(const std::string ¶m, EEncoding eflag) const
{
return m_impl->getQueryParam(param, eflag);
}
@@ -331,7 +331,7 @@
// -----------------------------------------------------------------
void
-Url::setScheme(const blocxx::String &scheme)
+Url::setScheme(const std::string &scheme)
{
if(scheme == m_impl->getScheme())
{
@@ -358,7 +358,7 @@
// -----------------------------------------------------------------
void
-Url::setAuthority(const blocxx::String &authority)
+Url::setAuthority(const std::string &authority)
{
m_impl->setAuthority(authority);
}
@@ -366,7 +366,7 @@
// -----------------------------------------------------------------
void
-Url::setPathData(const blocxx::String &pathdata)
+Url::setPathData(const std::string &pathdata)
{
m_impl->setPathData(pathdata);
}
@@ -374,7 +374,7 @@
// -----------------------------------------------------------------
void
-Url::setQueryString(const blocxx::String &querystr)
+Url::setQueryString(const std::string &querystr)
{
m_impl->setQueryString(querystr);
}
@@ -382,7 +382,7 @@
// -----------------------------------------------------------------
void
-Url::setFragment(const blocxx::String &fragment, EEncoding eflag)
+Url::setFragment(const std::string &fragment, EEncoding eflag)
{
m_impl->setFragment(fragment, eflag);
}
@@ -390,7 +390,7 @@
// -----------------------------------------------------------------
void
-Url::setUsername(const blocxx::String &user, EEncoding eflag)
+Url::setUsername(const std::string &user, EEncoding eflag)
{
m_impl->setUsername(user, eflag);
}
@@ -398,7 +398,7 @@
// -----------------------------------------------------------------
void
-Url::setPassword(const blocxx::String &pass, EEncoding eflag)
+Url::setPassword(const std::string &pass, EEncoding eflag)
{
m_impl->setPassword(pass, eflag);
}
@@ -406,7 +406,7 @@
// -----------------------------------------------------------------
void
-Url::setHost(const blocxx::String &host, EEncoding eflag)
+Url::setHost(const std::string &host, EEncoding eflag)
{
m_impl->setHost(host, eflag);
}
@@ -414,7 +414,7 @@
// -----------------------------------------------------------------
void
-Url::setPort(const blocxx::String &port)
+Url::setPort(const std::string &port)
{
m_impl->setPort(port);
}
@@ -422,7 +422,7 @@
// -----------------------------------------------------------------
void
-Url::setPathName(const blocxx::String &path, EEncoding eflag)
+Url::setPathName(const std::string &path, EEncoding eflag)
{
m_impl->setPathName(path, eflag);
}
@@ -430,7 +430,7 @@
// -----------------------------------------------------------------
void
-Url::setPathParams(const blocxx::String ¶ms)
+Url::setPathParams(const std::string ¶ms)
{
m_impl->setPathParams(params);
}
@@ -438,7 +438,7 @@
// -----------------------------------------------------------------
void
-Url::setPathParamsArray(const std::vectorblocxx::String &parray)
+Url::setPathParamsArray(const std::vectorstd::string &parray)
{
m_impl->setPathParamsArray(parray);
}
@@ -454,7 +454,7 @@
// -----------------------------------------------------------------
void
-Url::setPathParam(const blocxx::String ¶m, const blocxx::String &value)
+Url::setPathParam(const std::string ¶m, const std::string &value)
{
m_impl->setPathParam(param, value);
}
@@ -462,7 +462,7 @@
// -----------------------------------------------------------------
void
-Url::setQueryStringArray(const std::vectorblocxx::String &qarray)
+Url::setQueryStringArray(const std::vectorstd::string &qarray)
{
m_impl->setQueryStringArray(qarray);
}
@@ -477,7 +477,7 @@
// -----------------------------------------------------------------
void
-Url::setQueryParam(const blocxx::String ¶m, const blocxx::String &value)
+Url::setQueryParam(const std::string ¶m, const std::string &value)
{
m_impl->setQueryParam(param, value);
}
Modified: limal-branches/mc-devel/limal-ca-mgm/src/UrlBase.cpp
URL: http://svn.opensuse.org/viewcvs/limal/limal-branches/mc-devel/limal-ca-mgm/src/UrlBase.cpp?rev=2675&r1=2674&r2=2675&view=diff
==============================================================================
--- limal-branches/mc-devel/limal-ca-mgm/src/UrlBase.cpp (original)
+++ limal-branches/mc-devel/limal-ca-mgm/src/UrlBase.cpp Sat Jul 3 13:27:18 2010
@@ -18,8 +18,8 @@
/-*/
#include
-#include
-#include
+#include
+#include
#include "Utils.hpp"
@@ -74,9 +74,6 @@
namespace url
{
-using namespace blocxx;
-
-
// -------------------------------------------------------------------
ViewOptions::ViewOptions()
: opt(ViewOptions::WITH_SCHEME |
@@ -101,7 +98,7 @@
/*
** Behaviour configuration variables.
*/
-typedef std::map< blocxx::String, blocxx::String > UrlConfig;
+typedef std::map< std::string, std::string > UrlConfig;
// -------------------------------------------------------------------
@@ -127,15 +124,15 @@
UrlConfig config;
ViewOptions vopts;
- blocxx::String scheme;
- blocxx::String user;
- blocxx::String pass;
- blocxx::String host;
- blocxx::String port;
- blocxx::String pathname;
- blocxx::String pathparams;
- blocxx::String querystr;
- blocxx::String fragment;
+ std::string scheme;
+ std::string user;
+ std::string pass;
+ std::string host;
+ std::string port;
+ std::string pathname;
+ std::string pathparams;
+ std::string querystr;
+ std::string fragment;
};
@@ -148,17 +145,17 @@
// -----------------------------------------------------------
inline void
- checkUrlData(const blocxx::String &data,
- const blocxx::String &name,
- const blocxx::String ®x,
+ checkUrlData(const std::string &data,
+ const std::string &name,
+ const std::string ®x,
bool show=true)
{
if( regx.empty() || regx == "^$")
{
BLOCXX_THROW(UrlNotAllowedException,
- Format(__("The %1 url component is "
+ str::form(__("The %s url component is "
"not allowed in this scheme"),
- name).c_str()
+ name.c_str()).c_str()
);
}
@@ -175,14 +172,14 @@
if( show)
{
BLOCXX_THROW(UrlBadComponentException,
- Format(__("Invalid %1 URL component data '%2'."),
- name, data).c_str()
+ str::form(__("Invalid %s URL component data '%s'."),
+ name.c_str(), data.c_str()).c_str()
);
}
else
{
BLOCXX_THROW(UrlBadComponentException,
- Format(__("Invalid data in the %1 URL component."), name).c_str()
+ str::form(__("Invalid data in the %s URL component."), name.c_str()).c_str()
);
}
}
@@ -213,7 +210,7 @@
// -------------------------------------------------------------------
-UrlBase::UrlBase(const blocxx::String &urlString)
+UrlBase::UrlBase(const std::string &urlString)
: m_data( new UrlBaseData())
{
configure();
@@ -241,7 +238,7 @@
// -------------------------------------------------------------------
UrlBase&
-UrlBase::operator = (const blocxx::String &urlString)
+UrlBase::operator = (const std::string &urlString)
{
UrlBaseData saved_data( *m_data);
@@ -341,21 +338,21 @@
// -------------------------------------------------------------------
void
-UrlBase::config(const blocxx::String &opt, const blocxx::String &val)
+UrlBase::config(const std::string &opt, const std::string &val)
{
m_data->config[opt] = val;
}
// -------------------------------------------------------------------
-blocxx::String
-UrlBase::config(const blocxx::String &opt) const
+std::string
+UrlBase::config(const std::string &opt) const
{
UrlConfig::const_iterator v( m_data->config.find(opt));
if( v != m_data->config.end())
return v->second;
else
- return blocxx::String();
+ return std::string();
}
@@ -396,24 +393,24 @@
// -------------------------------------------------------------------
-std::vectorblocxx::String
+std::vectorstd::string
UrlBase::getKnownSchemes() const
{
- return std::vectorblocxx::String();
+ return std::vectorstd::string();
}
// -------------------------------------------------------------------
bool
-UrlBase::isKnownScheme(const blocxx::String &scheme) const
+UrlBase::isKnownScheme(const std::string &scheme) const
{
- String lscheme( String(scheme).toLowerCase());
- std::vectorblocxx::String schemes( getKnownSchemes());
- std::vectorblocxx::String::const_iterator s;
+ std::string lscheme( str::toLower(scheme));
+ std::vectorstd::string schemes( getKnownSchemes());
+ std::vectorstd::string::const_iterator s;
for(s=schemes.begin(); s!=schemes.end(); ++s)
{
- if( lscheme == String(*s).toLowerCase())
+ if( lscheme == str::toLower(*s))
return true;
}
return false;
@@ -422,7 +419,7 @@
// -------------------------------------------------------------------
bool
-UrlBase::isValidScheme(const blocxx::String &scheme) const
+UrlBase::isValidScheme(const std::string &scheme) const
{
bool valid = false;
try
@@ -435,16 +432,16 @@
if(valid)
{
- String lscheme( String(scheme).toLowerCase());
- std::vectorblocxx::String schemes( getKnownSchemes());
+ std::string lscheme( str::toLower(scheme));
+ std::vectorstd::string schemes( getKnownSchemes());
if( schemes.empty())
return true;
- std::vectorblocxx::String::const_iterator s;
+ std::vectorstd::string::const_iterator s;
for(s=schemes.begin(); s!=schemes.end(); ++s)
{
- if( lscheme == String(*s).toLowerCase())
+ if( lscheme == str::toLower(*s))
return true;
}
}
@@ -465,11 +462,11 @@
if( getScheme().empty())
return false;
- blocxx::String host( getHost(ca_mgm::url::E_ENCODED));
+ std::string host( getHost(ca_mgm::url::E_ENCODED));
if( host.empty() && config("require_host") != "n")
return false;
- blocxx::String path( getPathName(ca_mgm::url::E_ENCODED));
+ std::string path( getPathName(ca_mgm::url::E_ENCODED));
if( path.empty() && config("require_pathname") != "n")
return false;
@@ -477,7 +474,7 @@
** path has to begin with "/" if authority avaliable
** if host is set after the pathname, we can't throw
*/
- if( !host.empty() && !path.empty() && path.charAt(0) != '/')
+ if( !host.empty() && !path.empty() && path.at(0) != '/')
return false;
return true;
@@ -485,7 +482,7 @@
// -------------------------------------------------------------------
-blocxx::String
+std::string
UrlBase::toString() const
{
return toString(getViewOptions());
@@ -493,10 +490,10 @@
// -------------------------------------------------------------------
-blocxx::String
+std::string
UrlBase::toString(const ca_mgm::url::ViewOptions &opts) const
{
- blocxx::String url;
+ std::string url;
UrlBaseData tmp;
if( opts.has(ViewOptions::WITH_SCHEME))
@@ -561,12 +558,12 @@
tmp.pathname = getPathName(ca_mgm::url::E_ENCODED);
if( !tmp.pathname.empty())
{
- if(url.indexOf("/") != String::npos)
+ if(url.find_first_of("/") != std::string::npos)
{
// Url contains authority (that may be empty),
// we may need a rewrite of the encoded path.
tmp.pathname = cleanupPathName(tmp.pathname, true);
- if(tmp.pathname.charAt(0) != '/')
+ if(tmp.pathname.at(0) != '/')
{
url += "/";
}
@@ -587,7 +584,7 @@
}
}
else if( opts.has(ViewOptions::EMPTY_PATH_NAME)
- && url.indexOf("/") != String::npos)
+ && url.find_first_of("/") != std::string::npos)
{
url += "/";
if( opts.has(ViewOptions::EMPTY_PATH_PARAMS))
@@ -628,7 +625,7 @@
// -------------------------------------------------------------------
-blocxx::String
+std::string
UrlBase::getScheme() const
{
return m_data->scheme;
@@ -636,10 +633,10 @@
// -------------------------------------------------------------------
-blocxx::String
+std::string
UrlBase::getAuthority() const
{
- blocxx::String str;
+ std::string str;
if( !getHost(ca_mgm::url::E_ENCODED).empty())
{
if( !getUsername(ca_mgm::url::E_ENCODED).empty())
@@ -663,7 +660,7 @@
// -------------------------------------------------------------------
-blocxx::String
+std::string
UrlBase::getPathData() const
{
return getPathName(ca_mgm::url::E_ENCODED) +
@@ -673,7 +670,7 @@
// -------------------------------------------------------------------
-blocxx::String
+std::string
UrlBase::getQueryString() const
{
return m_data->querystr;
@@ -681,7 +678,7 @@
// -------------------------------------------------------------------
-blocxx::String
+std::string
UrlBase::getFragment(EEncoding eflag) const
{
if(eflag == ca_mgm::url::E_DECODED)
@@ -692,7 +689,7 @@
// -------------------------------------------------------------------
-blocxx::String
+std::string
UrlBase::getUsername(EEncoding eflag) const
{
if(eflag == ca_mgm::url::E_DECODED)
@@ -703,7 +700,7 @@
// -------------------------------------------------------------------
-blocxx::String
+std::string
UrlBase::getPassword(EEncoding eflag) const
{
if(eflag == ca_mgm::url::E_DECODED)
@@ -714,7 +711,7 @@
// -------------------------------------------------------------------
-blocxx::String
+std::string
UrlBase::getHost(EEncoding eflag) const
{
if(eflag == ca_mgm::url::E_DECODED)
@@ -725,7 +722,7 @@
// -------------------------------------------------------------------
-blocxx::String
+std::string
UrlBase::getPort() const
{
return m_data->port;
@@ -733,7 +730,7 @@
// -------------------------------------------------------------------
-blocxx::String
+std::string
UrlBase::getPathName(EEncoding eflag) const
{
if(eflag == ca_mgm::url::E_DECODED)
@@ -744,7 +741,7 @@
// -------------------------------------------------------------------
-blocxx::String
+std::string
UrlBase::getPathParams() const
{
return m_data->pathparams;
@@ -752,12 +749,12 @@
// -------------------------------------------------------------------
-std::vectorblocxx::String
+std::vectorstd::string
UrlBase::getPathParamsArray() const
{
if( config("psep_pathparam").empty())
{
- return std::vectorblocxx::String(1, getPathParams());
+ return std::vectorstd::string(1, getPathParams());
}
else
{
@@ -790,23 +787,23 @@
// -------------------------------------------------------------------
-blocxx::String
-UrlBase::getPathParam(const blocxx::String ¶m, EEncoding eflag) const
+std::string
+UrlBase::getPathParam(const std::string ¶m, EEncoding eflag) const
{
ca_mgm::url::ParamMap pmap( getPathParamsMap( eflag));
ca_mgm::url::ParamMap::const_iterator i( pmap.find(param));
- return i != pmap.end() ? i->second : blocxx::String();
+ return i != pmap.end() ? i->second : std::string();
}
// -------------------------------------------------------------------
-std::vectorblocxx::String
+std::vectorstd::string
UrlBase::getQueryStringArray() const
{
if( config("psep_querystr").empty())
{
- return std::vectorblocxx::String(1, getQueryString());
+ return std::vectorstd::string(1, getQueryString());
}
else
{
@@ -839,23 +836,23 @@
// -------------------------------------------------------------------
-blocxx::String
-UrlBase::getQueryParam(const blocxx::String ¶m, EEncoding eflag) const
+std::string
+UrlBase::getQueryParam(const std::string ¶m, EEncoding eflag) const
{
ca_mgm::url::ParamMap pmap( getQueryStringMap( eflag));
ca_mgm::url::ParamMap::const_iterator i( pmap.find(param));
- return i != pmap.end() ? i->second : blocxx::String();
+ return i != pmap.end() ? i->second : std::string();
}
// -------------------------------------------------------------------
void
-UrlBase::setScheme(const blocxx::String &scheme)
+UrlBase::setScheme(const std::string &scheme)
{
if( isValidScheme(scheme))
{
- m_data->scheme = String(scheme).toLowerCase();
+ m_data->scheme = str::toLower(scheme);
}
else
if( scheme.empty())
@@ -867,8 +864,8 @@
else
{
BLOCXX_THROW(UrlBadComponentException,
- Format(__("Invalid URL scheme '%1'."),
- scheme).c_str()
+ str::form(__("Invalid URL scheme '%s'."),
+ scheme.c_str()).c_str()
);
}
}
@@ -876,7 +873,7 @@
// -------------------------------------------------------------------
void
-UrlBase::setAuthority(const blocxx::String &authority)
+UrlBase::setAuthority(const std::string &authority)
{
UrlAuthority tmp( parse_url_authority(authority));
@@ -889,19 +886,19 @@
// -------------------------------------------------------------------
void
-UrlBase::setPathData(const blocxx::String &pathdata)
+UrlBase::setPathData(const std::string &pathdata)
{
- size_t pos = blocxx::String::npos;
- blocxx::String sep(config("sep_pathparams"));
+ size_t pos = std::string::npos;
+ std::string sep(config("sep_pathparams"));
if( !sep.empty())
- pos = pathdata.indexOf(sep);
+ pos = pathdata.find_first_of(sep);
- if( pos != String::npos)
+ if( pos != std::string::npos)
{
- setPathName(pathdata.substring(0, pos),
+ setPathName(pathdata.substr(0, pos),
ca_mgm::url::E_ENCODED);
- setPathParams(pathdata.substring(pos + 1));
+ setPathParams(pathdata.substr(pos + 1));
}
else
{
@@ -913,7 +910,7 @@
// -------------------------------------------------------------------
void
-UrlBase::setQueryString(const blocxx::String &querystr)
+UrlBase::setQueryString(const std::string &querystr)
{
if( querystr.empty())
{
@@ -930,7 +927,7 @@
// -------------------------------------------------------------------
void
-UrlBase::setFragment(const blocxx::String &fragment, EEncoding eflag)
+UrlBase::setFragment(const std::string &fragment, EEncoding eflag)
{
if( fragment.empty())
{
@@ -956,7 +953,7 @@
// -------------------------------------------------------------------
void
-UrlBase::setUsername(const blocxx::String &user, EEncoding eflag)
+UrlBase::setUsername(const std::string &user, EEncoding eflag)
{
if( user.empty())
{
@@ -990,7 +987,7 @@
// -------------------------------------------------------------------
void
-UrlBase::setPassword(const blocxx::String &pass, EEncoding eflag)
+UrlBase::setPassword(const std::string &pass, EEncoding eflag)
{
if( pass.empty())
{
@@ -1024,7 +1021,7 @@
// -------------------------------------------------------------------
void
-UrlBase::setHost(const blocxx::String &host, EEncoding eflag)
+UrlBase::setHost(const std::string &host, EEncoding eflag)
{
if( host.empty())
{
@@ -1048,9 +1045,9 @@
checkValidHost( host, eflag);
- if( host.charAt(0) == '[')
+ if( host.at(0) == '[')
{
- if( host.charAt(1) == 'v')
+ if( host.at(1) == 'v')
{
// Hmm... checkValidHost may be reimplemented
// and supports the IPvFuture brace format.
@@ -1068,7 +1065,7 @@
else
{
// use upper case in IPv6 addresses
- m_data->host = String(host).toUpperCase();
+ m_data->host = str::toUpper(host);
}
}
else
@@ -1076,15 +1073,14 @@
if(eflag == ca_mgm::url::E_ENCODED)
{
m_data->host = ca_mgm::url::encode(
- ca_mgm::url::decode(host).toLowerCase(),
+ str::toLower(ca_mgm::url::decode(host)),
SAFE_CHARS_HOSTNAME
);
}
else
{
m_data->host = ca_mgm::url::encode(
- String(host).toLowerCase(),
- SAFE_CHARS_HOSTNAME
+ str::toLower(host), SAFE_CHARS_HOSTNAME
);
}
}
@@ -1094,7 +1090,7 @@
// -------------------------------------------------------------------
void
-UrlBase::setPort(const blocxx::String &port)
+UrlBase::setPort(const std::string &port)
{
if( port.empty())
{
@@ -1120,7 +1116,7 @@
// -------------------------------------------------------------------
void
-UrlBase::setPathName(const blocxx::String &path, EEncoding eflag)
+UrlBase::setPathName(const std::string &path, EEncoding eflag)
{
if( path.empty())
{
@@ -1154,7 +1150,7 @@
// -------------------------------------------------------------------
void
-UrlBase::setPathParams(const blocxx::String ¶ms)
+UrlBase::setPathParams(const std::string ¶ms)
{
if( params.empty())
{
@@ -1171,7 +1167,7 @@
// -------------------------------------------------------------------
void
-UrlBase::setPathParamsArray(const std::vectorblocxx::String &parray)
+UrlBase::setPathParamsArray(const std::vectorstd::string &parray)
{
setPathParams(
ca_mgm::url::join(
@@ -1206,7 +1202,7 @@
// -------------------------------------------------------------------
void
-UrlBase::setPathParam(const blocxx::String ¶m, const blocxx::String &value)
+UrlBase::setPathParam(const std::string ¶m, const std::string &value)
{
ca_mgm::url::ParamMap pmap( getPathParamsMap(ca_mgm::url::E_DECODED));
pmap[param] = value;
@@ -1216,7 +1212,7 @@
// -------------------------------------------------------------------
void
-UrlBase::setQueryStringArray(const std::vectorblocxx::String &qarray)
+UrlBase::setQueryStringArray(const std::vectorstd::string &qarray)
{
setQueryString(
ca_mgm::url::join(
@@ -1250,7 +1246,7 @@
// -------------------------------------------------------------------
void
-UrlBase::setQueryParam(const blocxx::String ¶m, const blocxx::String &value)
+UrlBase::setQueryParam(const std::string ¶m, const std::string &value)
{
ca_mgm::url::ParamMap pmap( getQueryStringMap(ca_mgm::url::E_DECODED));
pmap[param] = value;
@@ -1259,24 +1255,24 @@
// -------------------------------------------------------------------
-blocxx::String
-UrlBase::cleanupPathName(const blocxx::String &path) const
+std::string
+UrlBase::cleanupPathName(const std::string &path) const
{
bool authority = !getHost(ca_mgm::url::E_ENCODED).empty();
return cleanupPathName(path, authority);
}
// -------------------------------------------------------------------
-blocxx::String
-UrlBase::cleanupPathName(const blocxx::String &path, bool authority) const
+std::string
+UrlBase::cleanupPathName(const std::string &path, bool authority) const
{
- blocxx::String copy( path);
+ std::string copy( path);
// decode the first slash if it is encoded ...
- if(copy.length() >= 3 && copy.charAt(0) != '/' &&
- copy.substring(0, 3).toLowerCase() == "%2f")
+ if(copy.length() >= 3 && copy.at(0) != '/' &&
+ str::toLower(copy.substr(0, 3)) == "%2f")
{
- copy = "/" + copy.substring(3);
+ copy = "/" + copy.substr(3);
}
// if path begins with a double slash ("//"); encode the second
@@ -1291,27 +1287,27 @@
if(config("path_encode_slash2") == "y")
{
// rewrite "//" ==> "/%2f"
- if(copy.length() >= 2 && copy.charAt(0) == '/' && copy.charAt(1) == '/')
+ if(copy.length() >= 2 && copy.at(0) == '/' && copy.at(1) == '/')
{
- copy = "/%2F" + copy.substring(2);
+ copy = "/%2F" + copy.substr(2);
}
}
else
{
// rewrite "/%2f" ==> "//"
- if(copy.length() >= 4 && copy.charAt(0) == '/' &&
- copy.substring(1, 4).toLowerCase() == "%2f")
+ if(copy.length() >= 4 && copy.at(0) == '/' &&
+ str::toLower(copy.substr(1, 4)) == "%2f")
{
- copy = "//" + copy.substring(4);
+ copy = "//" + copy.substr(4);
}
}
}
else
{
// rewrite of "//" to "/%2f" is required (no authority)
- if(copy.length() >= 2 && copy.charAt(0) == '/' && copy.charAt(1) == '/')
+ if(copy.length() >= 2 && copy.at(0) == '/' && copy.at(1) == '/')
{
- copy = "/%2F" + copy.substring(2);
+ copy = "/%2F" + copy.substr(2);
}
}
return copy;
@@ -1319,7 +1315,7 @@
// -------------------------------------------------------------------
void
-UrlBase::checkValidScheme(const blocxx::String &scheme,
+UrlBase::checkValidScheme(const std::string &scheme,
ca_mgm::url::EEncoding eflag) const
{
(void)eflag; // scheme never needs percent-encoding
@@ -1330,7 +1326,7 @@
// -------------------------------------------------------------------
void
-UrlBase::checkValidUser(const blocxx::String &user,
+UrlBase::checkValidUser(const std::string &user,
ca_mgm::url::EEncoding eflag) const
{
if( eflag == ca_mgm::url::E_ENCODED)
@@ -1342,7 +1338,7 @@
// -------------------------------------------------------------------
void
-UrlBase::checkValidPass(const blocxx::String &pass,
+UrlBase::checkValidPass(const std::string &pass,
ca_mgm::url::EEncoding eflag) const
{
if( eflag == ca_mgm::url::E_ENCODED)
@@ -1354,16 +1350,16 @@
// -------------------------------------------------------------------
void
-UrlBase::checkValidHost(const blocxx::String &host,
+UrlBase::checkValidHost(const std::string &host,
ca_mgm::url::EEncoding eflag) const
{
bool valid = false;
try
{
- if( host.charAt(0) == '[')
+ if( host.at(0) == '[')
{
// We don't support the IP-Literal "[v<HEX> ... ]" format
- if( host.charAt(1) == 'v')
+ if( host.at(1) == 'v')
{
BLOCXX_THROW(UrlBadComponentException,
__("The IPvFuture URL host format is not supported.")
@@ -1373,7 +1369,7 @@
checkUrlData(host, "ipv6 host", config("rx_hostipv6"));
struct in6_addr ip;
- blocxx::String temp( host.substring(1, host.length()-2));
+ std::string temp( host.substr(1, host.length()-2));
valid = inet_pton(AF_INET6, temp.c_str(), &ip) > 0;
}
else
@@ -1386,7 +1382,7 @@
}
else
{
- blocxx::String temp( ca_mgm::url::decode(host));
+ std::string temp( ca_mgm::url::decode(host));
checkUrlData(temp, "hostname", config("rx_hostname"));
valid = true;
}
@@ -1400,8 +1396,8 @@
if( !valid)
{
BLOCXX_THROW(UrlBadComponentException,
- Format(__("Invalid hostname URL component data '%1'."),
- host).c_str()
+ str::form(__("Invalid hostname URL component data '%s'."),
+ host.c_str()).c_str()
);
}
}
@@ -1409,7 +1405,7 @@
// -------------------------------------------------------------------
void
-UrlBase::checkValidPort(const blocxx::String &port,
+UrlBase::checkValidPort(const std::string &port,
ca_mgm::url::EEncoding eflag) const
{
(void)eflag; // port never needs percent-encoding
@@ -1419,7 +1415,7 @@
{
checkUrlData(port, "port number", config("rx_portnumber"));
- uint16_t pnum = port.toUInt16();
+ uint16_t pnum = str::strtonum(port);
valid = pnum >= 1;
}
catch( ... )
@@ -1430,8 +1426,8 @@
if( !valid)
{
BLOCXX_THROW(UrlBadComponentException,
- Format(__("Invalid port number URL component data '%1'."),
- port).c_str()
+ str::form(__("Invalid port number URL component data '%s'."),
+ port.c_str()).c_str()
);
}
}
@@ -1439,7 +1435,7 @@
// -------------------------------------------------------------------
void
-UrlBase::checkValidPathName(const blocxx::String &path,
+UrlBase::checkValidPathName(const std::string &path,
ca_mgm::url::EEncoding eflag) const
{
if(eflag == ca_mgm::url::E_ENCODED)
@@ -1452,8 +1448,8 @@
// setPathName while the host is empty, we allow
// it in encoded ("%2f") form - cleanupPathName()
// will fix / decode the first slash if needed.
- if(!(path.charAt(0) == '/' || (path.length() >= 3 &&
- path.substring(0, 3).toLowerCase() == "%2f")))
+ if(!(path.at(0) == '/' || (path.length() >= 3 &&
+ str::toLower(path.substr(0, 3)) == "%2f")))
{
BLOCXX_THROW(UrlNotAllowedException,
__("A relative path is not allowed if authority exists.")
@@ -1466,7 +1462,7 @@
{
if( !getHost(ca_mgm::url::E_ENCODED).empty())
{
- if(path.charAt(0) != '/')
+ if(path.at(0) != '/')
{
BLOCXX_THROW(UrlNotAllowedException,
__("A relative path is not allowed if authority exists.")
@@ -1479,7 +1475,7 @@
// -------------------------------------------------------------------
void
-UrlBase::checkValidPathParams(const blocxx::String ¶ms,
+UrlBase::checkValidPathParams(const std::string ¶ms,
ca_mgm::url::EEncoding eflag) const
{
if( eflag == ca_mgm::url::E_ENCODED)
@@ -1491,7 +1487,7 @@
// -------------------------------------------------------------------
void
-UrlBase::checkValidQueryStr(const blocxx::String &querystr,
+UrlBase::checkValidQueryStr(const std::string &querystr,
ca_mgm::url::EEncoding eflag) const
{
if( eflag == ca_mgm::url::E_ENCODED)
@@ -1503,7 +1499,7 @@
// -------------------------------------------------------------------
void
-UrlBase::checkValidFragment(const blocxx::String &fragment,
+UrlBase::checkValidFragment(const std::string &fragment,
ca_mgm::url::EEncoding eflag) const
{
if( eflag == ca_mgm::url::E_ENCODED)
Modified: limal-branches/mc-devel/limal-ca-mgm/src/UrlByScheme.cpp
URL: http://svn.opensuse.org/viewcvs/limal/limal-branches/mc-devel/limal-ca-mgm/src/UrlByScheme.cpp?rev=2675&r1=2674&r2=2675&view=diff
==============================================================================
--- limal-branches/mc-devel/limal-ca-mgm/src/UrlByScheme.cpp (original)
+++ limal-branches/mc-devel/limal-ca-mgm/src/UrlByScheme.cpp Sat Jul 3 13:27:18 2010
@@ -171,7 +171,7 @@
// -------------------------------------------------------------------
ca_mgm::url::UrlRef
-getUrlByScheme(const blocxx::String &scheme)
+getUrlByScheme(const std::string &scheme)
{
url_by_scheme *ptr;
for( ptr=url_by_scheme_table; ptr->scheme != NULL; ptr++)
Modified: limal-branches/mc-devel/limal-ca-mgm/src/UrlByScheme.hpp
URL: http://svn.opensuse.org/viewcvs/limal/limal-branches/mc-devel/limal-ca-mgm/src/UrlByScheme.hpp?rev=2675&r1=2674&r2=2675&view=diff
==============================================================================
--- limal-branches/mc-devel/limal-ca-mgm/src/UrlByScheme.hpp (original)
+++ limal-branches/mc-devel/limal-ca-mgm/src/UrlByScheme.hpp Sat Jul 3 13:27:18 2010
@@ -37,12 +37,12 @@
// -------------------------------------------------------------------
ca_mgm::url::UrlRef
-getUrlByScheme(const blocxx::String &scheme);
+getUrlByScheme(const std::string &scheme);
// -------------------------------------------------------------------
#if 0
-std::vectorblocxx::String
+std::vectorstd::string
getUrlBySchemeNames();
#endif
Modified: limal-branches/mc-devel/limal-ca-mgm/src/UrlUtils.cpp
URL: http://svn.opensuse.org/viewcvs/limal/limal-branches/mc-devel/limal-ca-mgm/src/UrlUtils.cpp?rev=2675&r1=2674&r2=2675&view=diff
==============================================================================
--- limal-branches/mc-devel/limal-ca-mgm/src/UrlUtils.cpp (original)
+++ limal-branches/mc-devel/limal-ca-mgm/src/UrlUtils.cpp Sat Jul 3 13:27:18 2010
@@ -18,8 +18,8 @@
/-*/
#include
-#include
-#include
+#include
+#include
#include "Utils.hpp"
@@ -67,30 +67,30 @@
inline size_t
find_first_not_of(const ca_mgm::ByteBuffer &src,
- const blocxx::String &set,
+ const std::string &set,
size_t off = 0)
{
for(size_t pos = off; pos < src.size(); pos++)
{
- if( set.indexOf(src.at(pos)) == String::npos)
+ if( set.find_first_of(src.at(pos)) == std::string::npos)
{
return pos;
}
}
- return blocxx::String::npos;
+ return std::string::npos;
}
} // anonymous namespace
// -------------------------------------------------------------------
-blocxx::String
-encode(const blocxx::String &str, const blocxx::String &safe,
+std::string
+encode(const std::string &str, const std::string &safe,
ca_mgm::url::EEncoding eflag)
{
if( str.empty())
{
- return String();
+ return std::string();
}
else
{
@@ -103,26 +103,26 @@
// -------------------------------------------------------------------
-blocxx::String
-encode_buf(const ca_mgm::ByteBuffer &buf, const blocxx::String &safe,
+std::string
+encode_buf(const ca_mgm::ByteBuffer &buf, const std::string &safe,
ca_mgm::url::EEncoding eflag)
{
if( buf.empty())
{
- return String();
+ return std::string();
}
- String skip("ABCDEFGHIJKLMNOPQRSTUVWXYZ"
- "abcdefghijklmnopqrstuvwxyz"
- "0123456789.~_-");
- String more(":/?#[]@!$&'()*+,;=");
- String out;
+ std::string skip("ABCDEFGHIJKLMNOPQRSTUVWXYZ"
+ "abcdefghijklmnopqrstuvwxyz"
+ "0123456789.~_-");
+ std::string more(":/?#[]@!$&'()*+,;=");
+ std::string out;
size_t beg, pos, len;
for(size_t i=0; i beg)
{
- out.concat(String(buf.data() + beg, pos - beg));
+ out += std::string(buf.data() + beg, pos - beg);
}
if( eflag == E_ENCODED &&
@@ -143,18 +143,18 @@
::isxdigit(buf.at(pos + 1)) &&
::isxdigit(buf.at(pos + 2)))
{
- out.concat(String(buf.data() + pos, 3));
+ out += std::string(buf.data() + pos, 3);
beg = pos + 3;
}
else
{
- out.concat( encode_octet( buf.at(pos)));
+ out += encode_octet( buf.at(pos));
beg = pos + 1;
}
}
else
{
- out.concat(String(buf.data() + beg, len - beg));
+ out += std::string(buf.data() + beg, len - beg);
beg = len;
}
}
@@ -163,16 +163,16 @@
// -------------------------------------------------------------------
-blocxx::String
-decode(const blocxx::String &str)
+std::string
+decode(const std::string &str)
{
- return String( ByteBuffer(decode_buf(str, false)).data());
+ return std::string( ByteBuffer(decode_buf(str, false)).data());
}
// -------------------------------------------------------------------
ca_mgm::ByteBuffer
-decode_buf(const blocxx::String &str, bool allowNUL)
+decode_buf(const std::string &str, bool allowNUL)
{
size_t pos, ins, len;
ByteBuffer out(str.c_str(), str.length());
@@ -181,7 +181,7 @@
pos = ins = 0;
while(pos < len)
{
- out[ins] = str.charAt(pos);
+ out[ins] = str.at(pos);
if( pos + 2 < len && out[pos] == '%')
{
int c = decode_octet(str.c_str() + pos + 1);
@@ -217,7 +217,7 @@
// -------------------------------------------------------------------
-blocxx::String
+std::string
encode_octet(const unsigned char c)
{
static const unsigned char tab[] = "0123456789ABCDEF";
@@ -229,7 +229,7 @@
out[3] = '\0';
//snprintf(out, sizeof(out), "%%%02X", c);
- return blocxx::String((char *)out);
+ return std::string((char *)out);
}
@@ -250,9 +250,9 @@
// -------------------------------------------------------------------
-std::vectorblocxx::String
-split(const blocxx::String &pstr,
- const blocxx::String &psep)
+std::vectorstd::string
+split(const std::string &pstr,
+ const std::string &psep)
{
if( psep.empty())
{
@@ -261,7 +261,7 @@
);
}
- std::vectorblocxx::String params;
+ std::vectorstd::string params;
size_t beg, pos, len;
len = pstr.length();
@@ -269,15 +269,15 @@
while( beg < len)
{
- pos = pstr.indexOf(psep, beg);
- if(pos != String::npos)
+ pos = pstr.find_first_of(psep, beg);
+ if(pos != std::string::npos)
{
- params.push_back( pstr.substring(beg, pos - beg));
+ params.push_back( pstr.substr(beg, pos - beg));
beg = pos + 1;
}
else
{
- params.push_back( pstr.substring(beg, len - beg));
+ params.push_back( pstr.substr(beg, len - beg));
beg = len;
}
}
@@ -287,9 +287,9 @@
// -------------------------------------------------------------------
ca_mgm::url::ParamMap
-split(const blocxx::String &str,
- const blocxx::String &psep,
- const blocxx::String &vsep,
+split(const std::string &str,
+ const std::string &psep,
+ const std::string &vsep,
EEncoding eflag)
{
if( psep.empty() || vsep.empty())
@@ -299,27 +299,27 @@
);
}
- std::vectorblocxx::String params( split(str, psep));
- std::vectorblocxx::String::const_iterator piter;
- blocxx::String key, val;
+ std::vectorstd::string params( split(str, psep));
+ std::vectorstd::string::const_iterator piter;
+ std::string key, val;
size_t pos;
ParamMap pmap;
for( piter = params.begin(); piter != params.end(); ++piter)
{
- pos = piter->indexOf(vsep);
- if(pos != String::npos)
+ pos = piter->find_first_of(vsep);
+ if(pos != std::string::npos)
{
if( eflag == E_DECODED)
{
- key = url::decode(piter->substring(0, pos));
- val = url::decode(piter->substring(pos + 1));
+ key = url::decode(piter->substr(0, pos));
+ val = url::decode(piter->substr(pos + 1));
pmap[ key ] = val;
}
else
{
- key = piter->substring(0, pos);
- val = piter->substring(pos + 1);
+ key = piter->substr(0, pos);
+ val = piter->substr(pos + 1);
pmap[ key ] = val;
}
}
@@ -340,12 +340,12 @@
// -------------------------------------------------------------------
-blocxx::String
-join(const std::vectorblocxx::String ¶ms,
- const blocxx::String &psep)
+std::string
+join(const std::vectorstd::string ¶ms,
+ const std::string &psep)
{
- blocxx::String str;
- std::vectorblocxx::String::const_iterator p( params.begin());
+ std::string str;
+ std::vectorstd::string::const_iterator p( params.begin());
if( p != params.end())
{
@@ -360,11 +360,11 @@
// -------------------------------------------------------------------
-blocxx::String
+std::string
join(const ca_mgm::url::ParamMap &pmap,
- const blocxx::String &psep,
- const blocxx::String &vsep,
- const blocxx::String &safe)
+ const std::string &psep,
+ const std::string &vsep,
+ const std::string &safe)
{
if( psep.empty() || vsep.empty())
{
@@ -373,16 +373,16 @@
);
}
- blocxx::String join_safe;
+ std::string join_safe;
for(size_t i=0; iblocxx::String cap;
+ std::vectorstd::string cap;
try
{
- blocxx::PosixRegEx reg(RX_SPLIT_URL);
- cap = convStringArray(reg.capture(url));
+ PosixRegEx reg(RX_SPLIT_URL);
+ cap = reg.capture(url);
}
catch(...)
{}
@@ -453,13 +453,13 @@
// -------------------------------------------------------------------
UrlAuthority
-parse_url_authority(const blocxx::String &authority)
+parse_url_authority(const std::string &authority)
{
- std::vectorblocxx::String cap;
+ std::vectorstd::string cap;
try
{
- blocxx::PosixRegEx reg(RX_SPLIT_URL_AUTHORITY);
- cap = convStringArray(reg.capture(authority));
+ PosixRegEx reg(RX_SPLIT_URL_AUTHORITY);
+ cap = reg.capture(authority);
}
catch(...)
{}
Modified: limal-branches/mc-devel/limal-ca-mgm/src/Utils.cpp
URL: http://svn.opensuse.org/viewcvs/limal/limal-branches/mc-devel/limal-ca-mgm/src/Utils.cpp?rev=2675&r1=2674&r2=2675&view=diff
==============================================================================
--- limal-branches/mc-devel/limal-ca-mgm/src/Utils.cpp (original)
+++ limal-branches/mc-devel/limal-ca-mgm/src/Utils.cpp Sat Jul 3 13:27:18 2010
@@ -68,18 +68,17 @@
// -------------------------------------------------------------------
int wrapExecuteProcessAndGatherOutput(
- const std::vectorblocxx::String &cmd,
- blocxx::String &out,
- blocxx::String &err,
- const blocxx::EnvVars &env,
- int tmax,
- int omax,
- const blocxx::String &in
+ const std::vectorstd::string &cmd,
+ std::string &out,
+ std::string &err,
+ const blocxx::EnvVars &env,
+ int tmax,
+ int omax,
+ const std::string &in
)
{
int exitStatus = -1;
-#if BLOCXX_LIBRARY_VERSION >= 5
blocxx::Process::Status status;
status = blocxx::Exec::executeProcessAndGatherOutput(
@@ -107,56 +106,20 @@
LOGIT_ERROR("Command '" << cmd[0]
<< "' execution in unknown state");
}
-#else
- int status = -1;
-
- blocxx::Exec::executeProcessAndGatherOutput(
- cmd, out, err, status, env,
- ( tmax < 0 ? blocxx::Exec::INFINITE_TIMEOUT : tmax
- ),
- omax, in
- );
-
- if( status != -1)
- {
- if(WIFEXITED(status))
- {
- exitStatus = WEXITSTATUS(status);
- }
- else
- if(WIFSIGNALED(status))
- {
- LOGIT_ERROR("Command '" << cmd[0]
- << "' terminated by signal: "
- << WTERMSIG(status));
- }
- else
- {
- LOGIT_ERROR("Command '" << cmd[0]
- << "' execution status: "
- << status);
- }
- }
- else
- {
- LOGIT_ERROR("Command '" << cmd[0]
- << "' execution failure: "
- << status);
- }
-#endif
-
return exitStatus;
}
-std::vectorblocxx::String
-convStringArray(const blocxx::StringArray &in)
+/* FIXME: remove
+std::vectorstd::string
+convStringArray(const std::stringArray &in)
{
- std::vectorblocxx::String out(in.begin(), in.end());
+ std::vectorstd::string out(in.begin(), in.end());
return out;
}
+*/
void
-appendArray(std::vectorblocxx::String &in, const std::vectorblocxx::String &arr)
+appendArray(std::vectorstd::string &in, const std::vectorstd::string &arr)
{
in.insert(in.end(), arr.begin(), arr.end());
}
Modified: limal-branches/mc-devel/limal-ca-mgm/src/Utils.hpp
URL: http://svn.opensuse.org/viewcvs/limal/limal-branches/mc-devel/limal-ca-mgm/src/Utils.hpp?rev=2675&r1=2674&r2=2675&view=diff
==============================================================================
--- limal-branches/mc-devel/limal-ca-mgm/src/Utils.hpp (original)
+++ limal-branches/mc-devel/limal-ca-mgm/src/Utils.hpp Sat Jul 3 13:27:18 2010
@@ -176,22 +176,22 @@
return checkAccessOID;
}
-inline std::vectorblocxx::String
+inline std::vectorstd::string
checkLiteralValueList(const std::list<LiteralValue>& list)
{
- std::vectorblocxx::String result;
+ std::vectorstd::string result;
std::list<LiteralValue>::const_iterator it = list.begin();
for(;it != list.end(); it++) {
//result.appendArray((*it).verify());
- std::vectorblocxx::String v = (*it).verify();
+ std::vectorstd::string v = (*it).verify();
result.insert(result.end(), v.begin(), v.end());
}
return result;
}
-inline blocxx::String type2Section(Type type, bool v3section)
+inline std::string type2Section(Type type, bool v3section)
{
- blocxx::String result;
+ std::string result;
switch(type)
{
@@ -239,7 +239,7 @@
break;
default:
LOGIT_ERROR("wrong type" << type);
- BLOCXX_THROW(ValueException, blocxx::Format("wrong type: %1", type).c_str());
+ BLOCXX_THROW(ValueException, str::form("wrong type: %d", type).c_str());
}
LOGIT_DEBUG("type2Section: type=" << type << " result=" << result);
return result;
@@ -247,26 +247,26 @@
// throws or returns the process exit code or -1 (term by signal).
int wrapExecuteProcessAndGatherOutput(
- const std::vectorblocxx::String &cmd,
- blocxx::String &out,
- blocxx::String &err,
- const blocxx::EnvVars &env,
- int tmax=-1,
- int omax=-1,
- const blocxx::String &in=blocxx::String()
+ const std::vectorstd::string &cmd,
+ std::string &out,
+ std::string &err,
+ const blocxx::EnvVars &env,
+ int tmax=-1,
+ int omax=-1,
+ const std::string &in=std::string()
);
-inline int rehashCAs(const blocxx::String &repositoryDir)
+inline int rehashCAs(const std::string &repositoryDir)
{
- std::vectorblocxx::String cmd;
+ std::vectorstd::string cmd;
cmd.push_back(C_REHASH_COMMAND);
cmd.push_back(repositoryDir);
blocxx::EnvVars env;
env.addVar("PATH", "/usr/bin/");
- blocxx::String stdOutput;
- blocxx::String errOutput;
+ std::string stdOutput;
+ std::string errOutput;
int status = -1;
try
{
@@ -279,7 +279,7 @@
}
if(status != 0)
{
- LOGIT_INFO( "c_rehash status:" << blocxx::String(status));
+ LOGIT_INFO( "c_rehash status:" << str::numstring(status));
}
if(!errOutput.empty())
{
@@ -295,8 +295,8 @@
return status;
}
-std::vectorblocxx::String convStringArray(const blocxx::StringArray &in);
-void appendArray(std::vectorblocxx::String &in, const std::vectorblocxx::String &arr);
+//std::vectorstd::string convStringArray(const std::stringArray &in);
+void appendArray(std::vectorstd::string &in, const std::vectorstd::string &arr);
}
Modified: limal-branches/mc-devel/limal-ca-mgm/src/ValueCheck.cpp
URL: http://svn.opensuse.org/viewcvs/limal/limal-branches/mc-devel/limal-ca-mgm/src/ValueCheck.cpp?rev=2675&r1=2674&r2=2675&view=diff
==============================================================================
--- limal-branches/mc-devel/limal-ca-mgm/src/ValueCheck.cpp (original)
+++ limal-branches/mc-devel/limal-ca-mgm/src/ValueCheck.cpp Sat Jul 3 13:27:18 2010
@@ -25,10 +25,9 @@
#include
#include
-#include
-#include
+#include
#include
-#include
+#include
#include
#include <list>
@@ -121,11 +120,11 @@
// -------------------------------------------------------------------
bool
-ValueCheck::isValid(const blocxx::String &value) const
+ValueCheck::isValid(const std::string &value) const
{
if( !m_self)
{
- BLOCXX_THROW(blocxx::NULLValueException,
+ BLOCXX_THROW(ca_mgm::ValueException,
__("The value check may not contain a NULL pointer."));
}
@@ -151,16 +150,16 @@
// -------------------------------------------------------------------
-blocxx::String
-ValueCheck::explain(const blocxx::String &value) const
+std::string
+ValueCheck::explain(const std::string &value) const
{
if( !m_self)
{
- BLOCXX_THROW(blocxx::NULLValueException,
+ BLOCXX_THROW(ca_mgm::ValueException,
__("The value check may not contain a NULL pointer."));
}
- String res(m_self->explain(value));
+ std::string res(m_self->explain(value));
if( !m_list.empty())
{
std::list<ValueCheck>::const_iterator i;
@@ -237,7 +236,7 @@
}
else
{
- BLOCXX_THROW(blocxx::NULLValueException,
+ BLOCXX_THROW(ca_mgm::ValueException,
__("The value check may not contain a NULL pointer."));
}
}
Modified: limal-branches/mc-devel/limal-ca-mgm/src/ValueIntCheck.cpp
URL: http://svn.opensuse.org/viewcvs/limal/limal-branches/mc-devel/limal-ca-mgm/src/ValueIntCheck.cpp?rev=2675&r1=2674&r2=2675&view=diff
==============================================================================
--- limal-branches/mc-devel/limal-ca-mgm/src/ValueIntCheck.cpp (original)
+++ limal-branches/mc-devel/limal-ca-mgm/src/ValueIntCheck.cpp Sat Jul 3 13:27:18 2010
@@ -27,15 +27,11 @@
#include
#include
-#include
-#include
+#include
namespace LIMAL_NAMESPACE
{
-using namespace blocxx;
-
-
// -------------------------------------------------------------------
ValueIntCheck::ValueIntCheck(int minValue,
int maxValue,
@@ -78,10 +74,10 @@
// -------------------------------------------------------------------
bool
-ValueIntCheck::isValid(const blocxx::String &value) const
+ValueIntCheck::isValid(const std::string &value) const
{
if( m_sign) {
- Int64 val = value.toInt64();
+ int64_t val = str::strtonum(value);
if( m_incl)
{
return (val >= m_min.s && val <= m_max.s);
@@ -91,7 +87,7 @@
return (val > m_min.s && val < m_max.s);
}
} else {
- UInt64 val = value.toUInt64();
+ uint64_t val = str::strtonum(value);
if( m_incl)
{
return (val >= m_min.u && val <= m_max.u);
@@ -105,19 +101,21 @@
// -------------------------------------------------------------------
-blocxx::String
-ValueIntCheck::explain(const blocxx::String &value) const
+std::string
+ValueIntCheck::explain(const std::string &value) const
{
- String s;
- String o(m_incl ? "=" : "");
+ std::string s;
+ std::string o(m_incl ? "=" : "");
if( m_sign) {
- s = Format("ValueIntCheck('%1' >%2 %3 && '%4' <%5 %6)",
- value, o, m_min.s, value, o, m_max.s);
+ s = str::form("ValueIntCheck(%s >%s %lld && %s <%s %lld)",
+ value.c_str(), o.c_str(), m_min.s,
+ value.c_str(), o.c_str(), m_max.s);
}
else
{
- s = Format("ValueIntCheck('%1' >%2 %3 && '%4' <%5 %6)",
- value, o, m_min.u, value, o, m_max.u);
+ s = str::form("ValueIntCheck('%s' >%s %lld && '%s' <%s %lld)",
+ value.c_str(), o.c_str(), m_min.u,
+ value.c_str(), o.c_str(), m_max.u);
}
return s;
}
Modified: limal-branches/mc-devel/limal-ca-mgm/src/ValuePerlRECheck.cpp
URL: http://svn.opensuse.org/viewcvs/limal/limal-branches/mc-devel/limal-ca-mgm/src/ValuePerlRECheck.cpp?rev=2675&r1=2674&r2=2675&view=diff
==============================================================================
--- limal-branches/mc-devel/limal-ca-mgm/src/ValuePerlRECheck.cpp (original)
+++ limal-branches/mc-devel/limal-ca-mgm/src/ValuePerlRECheck.cpp Sat Jul 3 13:27:18 2010
@@ -27,11 +27,9 @@
#include
#include
-#include
-#include
+#include
-#ifdef BLOCXX_HAVE_PCRE
namespace LIMAL_NAMESPACE
{
@@ -39,7 +37,7 @@
// -------------------------------------------------------------------
-ValuePerlRECheck::ValuePerlRECheck(const blocxx::String ®ex,
+ValuePerlRECheck::ValuePerlRECheck(const std::string ®ex,
bool icase,
bool utf8)
: ValueCheckBase()
@@ -61,22 +59,21 @@
// -------------------------------------------------------------------
bool
-ValuePerlRECheck::isValid(const blocxx::String &value) const
+ValuePerlRECheck::isValid(const std::string &value) const
{
return m_reg.match(value);
}
// -------------------------------------------------------------------
-blocxx::String
-ValuePerlRECheck::explain(const blocxx::String &value) const
+std::string
+ValuePerlRECheck::explain(const std::string &value) const
{
- return blocxx::Format("ValuePerlRECheck('%1' =~ /%2/%3)",
- value, m_reg.patternString(),
+ return str::form("ValuePerlRECheck('%s' =~ /%s/%s)",
+ value.c_str(), m_reg.patternString().c_str(),
(m_reg.compileFlags() & PCRE_CASELESS ? "i" : ""));
}
} // End of LIMAL_NAMESPACE
-#endif
// vim: set ts=8 sts=8 sw=8 ai noet:
Modified: limal-branches/mc-devel/limal-ca-mgm/src/ValuePosixRECheck.cpp
URL: http://svn.opensuse.org/viewcvs/limal/limal-branches/mc-devel/limal-ca-mgm/src/ValuePosixRECheck.cpp?rev=2675&r1=2674&r2=2675&view=diff
==============================================================================
--- limal-branches/mc-devel/limal-ca-mgm/src/ValuePosixRECheck.cpp (original)
+++ limal-branches/mc-devel/limal-ca-mgm/src/ValuePosixRECheck.cpp Sat Jul 3 13:27:18 2010
@@ -27,11 +27,9 @@
#include
#include
-#include
-#include
+#include
-#ifdef BLOCXX_HAVE_REGEX
namespace LIMAL_NAMESPACE
{
@@ -39,7 +37,7 @@
// -------------------------------------------------------------------
-ValuePosixRECheck::ValuePosixRECheck(const blocxx::String ®ex,
+ValuePosixRECheck::ValuePosixRECheck(const std::string ®ex,
bool icase)
: ValueCheckBase()
, m_reg(regex, REG_EXTENDED | REG_NOSUB | (icase ? REG_ICASE : 0))
@@ -59,22 +57,21 @@
// -------------------------------------------------------------------
bool
-ValuePosixRECheck::isValid(const blocxx::String &value) const
+ValuePosixRECheck::isValid(const std::string &value) const
{
return m_reg.match(value);
}
// -------------------------------------------------------------------
-blocxx::String
-ValuePosixRECheck::explain(const blocxx::String &value) const
+std::string
+ValuePosixRECheck::explain(const std::string &value) const
{
- return blocxx::Format("ValuePosixRECheck('%1' =~ /%2/%3)",
- value, m_reg.patternString(),
- (m_reg.compileFlags() & REG_ICASE ? "i" : ""));
+ return str::form("ValuePosixRECheck('%s' =~ /%s/%s)",
+ value.c_str(), m_reg.patternString().c_str(),
+ (m_reg.compileFlags() & REG_ICASE ? "i" : ""));
}
} // End of LIMAL_NAMESPACE
-#endif
// vim: set ts=8 sts=8 sw=8 ai noet:
Modified: limal-branches/mc-devel/limal-ca-mgm/src/X509v3CRLExtensions.cpp
URL: http://svn.opensuse.org/viewcvs/limal/limal-branches/mc-devel/limal-ca-mgm/src/X509v3CRLExtensions.cpp?rev=2675&r1=2674&r2=2675&view=diff
==============================================================================
--- limal-branches/mc-devel/limal-ca-mgm/src/X509v3CRLExtensions.cpp (original)
+++ limal-branches/mc-devel/limal-ca-mgm/src/X509v3CRLExtensions.cpp Sat Jul 3 13:27:18 2010
@@ -69,10 +69,10 @@
return true;
}
-std::vectorblocxx::String
+std::vectorstd::string
X509v3CRLExts::verify() const
{
- std::vectorblocxx::String result;
+ std::vectorstd::string result;
appendArray(result, m_impl->authorityKeyIdentifier.verify());
appendArray(result, m_impl->issuerAlternativeName.verify());
@@ -81,10 +81,10 @@
return result;;
}
-std::vectorblocxx::String
+std::vectorstd::string
X509v3CRLExts::dump() const
{
- std::vectorblocxx::String result;
+ std::vectorstd::string result;
result.push_back("X509v3CRLExts::dump()");
appendArray(result, m_impl->authorityKeyIdentifier.dump());
Modified: limal-branches/mc-devel/limal-ca-mgm/src/X509v3CRLExtensions_Priv.cpp
URL: http://svn.opensuse.org/viewcvs/limal/limal-branches/mc-devel/limal-ca-mgm/src/X509v3CRLExtensions_Priv.cpp?rev=2675&r1=2674&r2=2675&view=diff
==============================================================================
--- limal-branches/mc-devel/limal-ca-mgm/src/X509v3CRLExtensions_Priv.cpp (original)
+++ limal-branches/mc-devel/limal-ca-mgm/src/X509v3CRLExtensions_Priv.cpp Sat Jul 3 13:27:18 2010
@@ -71,7 +71,7 @@
void
X509v3CRLExts_Priv::setAuthorityKeyIdentifier(const AuthorityKeyIdentifierExt &ext)
{
- std::vectorblocxx::String r = ext.verify();
+ std::vectorstd::string r = ext.verify();
if(!r.empty())
{
LOGIT_ERROR(r[0]);
@@ -83,7 +83,7 @@
void
X509v3CRLExts_Priv::setIssuerAlternativeName(const IssuerAlternativeNameExt &ext)
{
- std::vectorblocxx::String r = ext.verify();
+ std::vectorstd::string r = ext.verify();
if(!r.empty())
{
LOGIT_ERROR(r[0]);
@@ -135,7 +135,7 @@
LOGIT_ERROR("Unable to parse the certificate (" << "Crit:" << crit << ")");
BLOCXX_THROW(ca_mgm::SyntaxException,
- Format(__("Unable to parse the certificate (Crit: %1)."),
+ str::form(__("Unable to parse the certificate (Crit: %1)."),
crit).c_str());
}
Modified: limal-branches/mc-devel/limal-ca-mgm/src/X509v3CRLGenerationExtensions.cpp
URL: http://svn.opensuse.org/viewcvs/limal/limal-branches/mc-devel/limal-ca-mgm/src/X509v3CRLGenerationExtensions.cpp?rev=2675&r1=2674&r2=2675&view=diff
==============================================================================
--- limal-branches/mc-devel/limal-ca-mgm/src/X509v3CRLGenerationExtensions.cpp (original)
+++ limal-branches/mc-devel/limal-ca-mgm/src/X509v3CRLGenerationExtensions.cpp Sat Jul 3 13:27:18 2010
@@ -159,10 +159,10 @@
return true;
}
-std::vectorblocxx::String
+std::vectorstd::string
X509v3CRLGenerationExts::verify() const
{
- std::vectorblocxx::String result;
+ std::vectorstd::string result;
appendArray(result, m_impl->authorityKeyIdentifier.verify());
appendArray(result, m_impl->issuerAlternativeName.verify());
@@ -171,10 +171,10 @@
return result;;
}
-std::vectorblocxx::String
+std::vectorstd::string
X509v3CRLGenerationExts::dump() const
{
- std::vectorblocxx::String result;
+ std::vectorstd::string result;
result.push_back("X509v3CRLGenerationExts::dump()");
appendArray(result, m_impl->authorityKeyIdentifier.dump());
Modified: limal-branches/mc-devel/limal-ca-mgm/src/X509v3CertificateExtensions.cpp
URL: http://svn.opensuse.org/viewcvs/limal/limal-branches/mc-devel/limal-ca-mgm/src/X509v3CertificateExtensions.cpp?rev=2675&r1=2674&r2=2675&view=diff
==============================================================================
--- limal-branches/mc-devel/limal-ca-mgm/src/X509v3CertificateExtensions.cpp (original)
+++ limal-branches/mc-devel/limal-ca-mgm/src/X509v3CertificateExtensions.cpp Sat Jul 3 13:27:18 2010
@@ -181,10 +181,10 @@
return true;
}
-std::vectorblocxx::String
+std::vectorstd::string
X509v3CertificateExts::verify() const
{
- std::vectorblocxx::String result;
+ std::vectorstd::string result;
appendArray(result, m_impl->nsBaseUrl.verify());
appendArray(result, m_impl->nsRevocationUrl.verify());
@@ -209,10 +209,10 @@
return result;
}
-std::vectorblocxx::String
+std::vectorstd::string
X509v3CertificateExts::dump() const
{
- std::vectorblocxx::String result;
+ std::vectorstd::string result;
result.push_back("X509v3CertificateExts::dump()");
appendArray(result, m_impl->nsBaseUrl.dump());
Modified: limal-branches/mc-devel/limal-ca-mgm/src/X509v3CertificateExtensionsImpl.hpp
URL: http://svn.opensuse.org/viewcvs/limal/limal-branches/mc-devel/limal-ca-mgm/src/X509v3CertificateExtensionsImpl.hpp?rev=2675&r1=2674&r2=2675&view=diff
==============================================================================
--- limal-branches/mc-devel/limal-ca-mgm/src/X509v3CertificateExtensionsImpl.hpp (original)
+++ limal-branches/mc-devel/limal-ca-mgm/src/X509v3CertificateExtensionsImpl.hpp Sat Jul 3 13:27:18 2010
@@ -94,7 +94,7 @@
return new X509v3CertificateExtsImpl(*this);
}
- /* String extensions */
+ /* std::string extensions */
NsBaseUrlExt nsBaseUrl;
NsRevocationUrlExt nsRevocationUrl;
@@ -104,7 +104,7 @@
NsSslServerNameExt nsSslServerName;
NsCommentExt nsComment;
- /* Bit Strings */
+ /* Bit std::strings */
KeyUsageExt keyUsage;
NsCertTypeExt nsCertType;
Modified: limal-branches/mc-devel/limal-ca-mgm/src/X509v3CertificateExtensions_Priv.cpp
URL: http://svn.opensuse.org/viewcvs/limal/limal-branches/mc-devel/limal-ca-mgm/src/X509v3CertificateExtensions_Priv.cpp?rev=2675&r1=2674&r2=2675&view=diff
==============================================================================
--- limal-branches/mc-devel/limal-ca-mgm/src/X509v3CertificateExtensions_Priv.cpp (original)
+++ limal-branches/mc-devel/limal-ca-mgm/src/X509v3CertificateExtensions_Priv.cpp Sat Jul 3 13:27:18 2010
@@ -141,7 +141,7 @@
void
X509v3CertificateExts_Priv::setNsBaseUrl(const NsBaseUrlExt &ext)
{
- std::vectorblocxx::String r = ext.verify();
+ std::vectorstd::string r = ext.verify();
if(!r.empty())
{
LOGIT_ERROR(r[0]);
@@ -153,7 +153,7 @@
void
X509v3CertificateExts_Priv::setNsRevocationUrl(const NsRevocationUrlExt &ext)
{
- std::vectorblocxx::String r = ext.verify();
+ std::vectorstd::string r = ext.verify();
if(!r.empty())
{
LOGIT_ERROR(r[0]);
@@ -165,7 +165,7 @@
void
X509v3CertificateExts_Priv::setNsCaRevocationUrl(const NsCaRevocationUrlExt &ext)
{
- std::vectorblocxx::String r = ext.verify();
+ std::vectorstd::string r = ext.verify();
if(!r.empty())
{
LOGIT_ERROR(r[0]);
@@ -177,7 +177,7 @@
void
X509v3CertificateExts_Priv::setNsRenewalUrl(const NsRenewalUrlExt &ext)
{
- std::vectorblocxx::String r = ext.verify();
+ std::vectorstd::string r = ext.verify();
if(!r.empty())
{
LOGIT_ERROR(r[0]);
@@ -189,7 +189,7 @@
void
X509v3CertificateExts_Priv::setNsCaPolicyUrl(const NsCaPolicyUrlExt &ext)
{
- std::vectorblocxx::String r = ext.verify();
+ std::vectorstd::string r = ext.verify();
if(!r.empty())
{
LOGIT_ERROR(r[0]);
@@ -201,7 +201,7 @@
void
X509v3CertificateExts_Priv::setNsSslServerName(const NsSslServerNameExt &ext)
{
- std::vectorblocxx::String r = ext.verify();
+ std::vectorstd::string r = ext.verify();
if(!r.empty())
{
LOGIT_ERROR(r[0]);
@@ -213,7 +213,7 @@
void
X509v3CertificateExts_Priv::setNsComment(const NsCommentExt &ext)
{
- std::vectorblocxx::String r = ext.verify();
+ std::vectorstd::string r = ext.verify();
if(!r.empty())
{
LOGIT_ERROR(r[0]);
@@ -225,7 +225,7 @@
void
X509v3CertificateExts_Priv::setNsCertType(const NsCertTypeExt &ext)
{
- std::vectorblocxx::String r = ext.verify();
+ std::vectorstd::string r = ext.verify();
if(!r.empty())
{
LOGIT_ERROR(r[0]);
@@ -237,7 +237,7 @@
void
X509v3CertificateExts_Priv::setKeyUsage(const KeyUsageExt &ext)
{
- std::vectorblocxx::String r = ext.verify();
+ std::vectorstd::string r = ext.verify();
if(!r.empty())
{
LOGIT_ERROR(r[0]);
@@ -249,7 +249,7 @@
void
X509v3CertificateExts_Priv::setBasicConstraints(const BasicConstraintsExt &ext)
{
- std::vectorblocxx::String r = ext.verify();
+ std::vectorstd::string r = ext.verify();
if(!r.empty())
{
LOGIT_ERROR(r[0]);
@@ -261,7 +261,7 @@
void
X509v3CertificateExts_Priv::setExtendedKeyUsage(const ExtendedKeyUsageExt &ext)
{
- std::vectorblocxx::String r = ext.verify();
+ std::vectorstd::string r = ext.verify();
if(!r.empty())
{
LOGIT_ERROR(r[0]);
@@ -273,7 +273,7 @@
void
X509v3CertificateExts_Priv::setSubjectKeyIdentifier(const SubjectKeyIdentifierExt &ext)
{
- std::vectorblocxx::String r = ext.verify();
+ std::vectorstd::string r = ext.verify();
if(!r.empty())
{
LOGIT_ERROR(r[0]);
@@ -285,7 +285,7 @@
void
X509v3CertificateExts_Priv::setAuthorityKeyIdentifier(const AuthorityKeyIdentifierExt &ext)
{
- std::vectorblocxx::String r = ext.verify();
+ std::vectorstd::string r = ext.verify();
if(!r.empty())
{
LOGIT_ERROR(r[0]);
@@ -297,7 +297,7 @@
void
X509v3CertificateExts_Priv::setSubjectAlternativeName(const SubjectAlternativeNameExt &ext)
{
- std::vectorblocxx::String r = ext.verify();
+ std::vectorstd::string r = ext.verify();
if(!r.empty())
{
LOGIT_ERROR(r[0]);
@@ -309,7 +309,7 @@
void
X509v3CertificateExts_Priv::setIssuerAlternativeName(const IssuerAlternativeNameExt &ext)
{
- std::vectorblocxx::String r = ext.verify();
+ std::vectorstd::string r = ext.verify();
if(!r.empty())
{
LOGIT_ERROR(r[0]);
@@ -321,7 +321,7 @@
void
X509v3CertificateExts_Priv::setAuthorityInfoAccess(const AuthorityInfoAccessExt &ext)
{
- std::vectorblocxx::String r = ext.verify();
+ std::vectorstd::string r = ext.verify();
if(!r.empty())
{
LOGIT_ERROR(r[0]);
@@ -333,7 +333,7 @@
void
X509v3CertificateExts_Priv::setCRLDistributionPoints(const CRLDistributionPointsExt &ext)
{
- std::vectorblocxx::String r = ext.verify();
+ std::vectorstd::string r = ext.verify();
if(!r.empty())
{
LOGIT_ERROR(r[0]);
@@ -345,7 +345,7 @@
void
X509v3CertificateExts_Priv::setCertificatePolicies(const CertificatePoliciesExt &ext)
{
- std::vectorblocxx::String r = ext.verify();
+ std::vectorstd::string r = ext.verify();
if(!r.empty())
{
LOGIT_ERROR(r[0]);
@@ -390,14 +390,14 @@
// extension occurred more than once
LOGIT_ERROR("Extension occurred more than once: " << nid);
BLOCXX_THROW(SyntaxException,
- Format(__("Extension occurred more than once: %1."),
+ str::form(__("Extension occurred more than once: %1."),
nid).c_str());
}
LOGIT_ERROR("Unable to parse the certificate (NID:" <<
nid << " Crit:" << crit << ")");
BLOCXX_THROW(SyntaxException,
- Format(__("Unable to parse the certificate (NID: %1 Crit: %2)."),
+ str::form(__("Unable to parse the certificate (NID: %1 Crit: %2)."),
nid, crit).c_str());
}
@@ -447,14 +447,14 @@
// extension occurred more than once
LOGIT_ERROR("Extension occurred more than once: " << nid);
BLOCXX_THROW(SyntaxException,
- Format(__("Extension occurred more than once: %1."),
+ str::form(__("Extension occurred more than once: %1."),
nid).c_str());
}
LOGIT_ERROR("Unable to parse the certificate (NID:" <<
nid << " Crit:" << crit << ")");
BLOCXX_THROW(SyntaxException,
- Format(__("Unable to parse the certificate (NID: %1 Crit: %2)."),
+ str::form(__("Unable to parse the certificate (NID: %1 Crit: %2)."),
nid, crit).c_str());
}
@@ -511,7 +511,7 @@
LOGIT_ERROR("Unable to parse the certificate (" << "Crit:" << crit << ")");
BLOCXX_THROW(SyntaxException,
- Format(__("Unable to parse the certificate (Crit: %1)."),
+ str::form(__("Unable to parse the certificate (Crit: %1)."),
crit).c_str());
}
@@ -530,7 +530,7 @@
}
else
{
- usageList.push_back(String(OBJ_nid2sn(nid)));
+ usageList.push_back(std::string(OBJ_nid2sn(nid)));
}
}
ext.setExtendedKeyUsage(usageList);
@@ -577,7 +577,7 @@
LOGIT_ERROR("Unable to parse the certificate (" << "Crit:" << crit << ")");
BLOCXX_THROW(SyntaxException,
- Format(__("Unable to parse the certificate (Crit: %1)."),
+ str::form(__("Unable to parse the certificate (Crit: %1)."),
crit).c_str());
}
@@ -641,18 +641,15 @@
LOGIT_ERROR("Unable to parse the certificate (" << "Crit:" << crit << ")");
BLOCXX_THROW(SyntaxException,
- Format(__("Unable to parse the certificate (Crit: %1)."),
+ str::form(__("Unable to parse the certificate (Crit: %1)."),
crit).c_str());
}
- String s;
+ std::string s;
for(int i = 0; i < ski->length; ++i)
{
- String d;
- d.format("%02x", ski->data[i]);
-
- s += d;
+ s += str::form( "%02x", ski->data[i]);
if( (i+1) < ski->length)
{
s += ":";
@@ -704,7 +701,7 @@
LOGIT_ERROR("Unable to parse the certificate (" << "Crit:" << crit << ")");
BLOCXX_THROW(SyntaxException,
- Format(__("Unable to parse the certificate (Crit: %1)."),
+ str::form(__("Unable to parse the certificate (Crit: %1)."),
crit).c_str());
}
@@ -773,7 +770,7 @@
LOGIT_ERROR("Unable to parse the certificate (" << "Crit:" << crit << ")");
BLOCXX_THROW(SyntaxException,
- Format(__("Unable to parse the certificate (Crit: %1)."),
+ str::form(__("Unable to parse the certificate (Crit: %1)."),
crit).c_str());
}
@@ -843,7 +840,7 @@
LOGIT_ERROR("Unable to parse the certificate (" << "Crit:" << crit << ")");
BLOCXX_THROW(SyntaxException,
- Format(__("Unable to parse the certificate (Crit: %1)."),
+ str::form(__("Unable to parse the certificate (Crit: %1)."),
crit).c_str());
}
@@ -918,7 +915,7 @@
LOGIT_ERROR("Unable to parse the certificate (" << "Crit:" << crit << ")");
BLOCXX_THROW(SyntaxException,
- Format(__("Unable to parse the certificate (Crit: %1)."), crit).c_str());
+ str::form(__("Unable to parse the certificate (Crit: %1)."), crit).c_str());
}
@@ -941,7 +938,7 @@
__("Invalid location in authorityInfoAccess."));
}
- String method;
+ std::string method;
i2t_ASN1_OBJECT(objtmp, sizeof objtmp, desc->method);
@@ -949,11 +946,11 @@
if(nid == 0)
{
- method = String(objtmp);
+ method = std::string(objtmp);
}
else
{
- method = String(OBJ_nid2sn(nid));
+ method = std::string(OBJ_nid2sn(nid));
}
AuthorityInformation ai(method, lv);
@@ -1004,7 +1001,7 @@
LOGIT_ERROR("Unable to parse the certificate (" << "Crit:" << crit << ")");
BLOCXX_THROW(SyntaxException,
- Format(__("Unable to parse the certificate (Crit: %1)."),
+ str::form(__("Unable to parse the certificate (Crit: %1)."),
crit).c_str());
}
@@ -1042,7 +1039,7 @@
memcpy(s, qualinfo->d.cpsuri->data, qualinfo->d.cpsuri->length);
s[qualinfo->d.cpsuri->length] = '\0';
- cpsURI.push_back(String(s));
+ cpsURI.push_back(std::string(s));
delete [] s;
break;
case NID_id_qt_unotice:
Modified: limal-branches/mc-devel/limal-ca-mgm/src/X509v3CertificateIssueExtensions.cpp
URL: http://svn.opensuse.org/viewcvs/limal/limal-branches/mc-devel/limal-ca-mgm/src/X509v3CertificateIssueExtensions.cpp?rev=2675&r1=2674&r2=2675&view=diff
==============================================================================
--- limal-branches/mc-devel/limal-ca-mgm/src/X509v3CertificateIssueExtensions.cpp (original)
+++ limal-branches/mc-devel/limal-ca-mgm/src/X509v3CertificateIssueExtensions.cpp Sat Jul 3 13:27:18 2010
@@ -109,7 +109,7 @@
return new X509v3CertificateIssueExtsImpl(*this);
}
- /* String extensions */
+ /* std::string extensions */
NsBaseUrlExt nsBaseUrl;
NsRevocationUrlExt nsRevocationUrl;
@@ -119,7 +119,7 @@
NsSslServerNameExt nsSslServerName;
NsCommentExt nsComment;
- /* Bit Strings */
+ /* Bit std::strings */
KeyUsageExt keyUsage;
NsCertTypeExt nsCertType;
@@ -631,10 +631,10 @@
return true;
}
-std::vectorblocxx::String
+std::vectorstd::string
X509v3CertificateIssueExts::verify() const
{
- std::vectorblocxx::String result;
+ std::vectorstd::string result;
appendArray(result, m_impl->nsBaseUrl.verify());
appendArray(result, m_impl->nsRevocationUrl.verify());
@@ -659,10 +659,10 @@
return result;
}
-std::vectorblocxx::String
+std::vectorstd::string
X509v3CertificateIssueExts::dump() const
{
- std::vectorblocxx::String result;
+ std::vectorstd::string result;
result.push_back("X509v3CertificateIssueExts::dump()");
appendArray(result, m_impl->nsBaseUrl.dump());
Modified: limal-branches/mc-devel/limal-ca-mgm/src/X509v3RequestExtensions.cpp
URL: http://svn.opensuse.org/viewcvs/limal/limal-branches/mc-devel/limal-ca-mgm/src/X509v3RequestExtensions.cpp?rev=2675&r1=2674&r2=2675&view=diff
==============================================================================
--- limal-branches/mc-devel/limal-ca-mgm/src/X509v3RequestExtensions.cpp (original)
+++ limal-branches/mc-devel/limal-ca-mgm/src/X509v3RequestExtensions.cpp Sat Jul 3 13:27:18 2010
@@ -276,10 +276,10 @@
return true;
}
-std::vectorblocxx::String
+std::vectorstd::string
X509v3RequestExts::verify() const
{
- std::vectorblocxx::String result;
+ std::vectorstd::string result;
appendArray(result, m_impl->nsSslServerName.verify());
appendArray(result, m_impl->nsComment.verify());
@@ -294,10 +294,10 @@
return result;
}
-std::vectorblocxx::String
+std::vectorstd::string
X509v3RequestExts::dump() const
{
- std::vectorblocxx::String result;
+ std::vectorstd::string result;
result.push_back("X509v3RequestExts::dump()");
appendArray(result, m_impl->nsSslServerName.dump());
Modified: limal-branches/mc-devel/limal-ca-mgm/src/X509v3RequestExtensionsImpl.hpp
URL: http://svn.opensuse.org/viewcvs/limal/limal-branches/mc-devel/limal-ca-mgm/src/X509v3RequestExtensionsImpl.hpp?rev=2675&r1=2674&r2=2675&view=diff
==============================================================================
--- limal-branches/mc-devel/limal-ca-mgm/src/X509v3RequestExtensionsImpl.hpp (original)
+++ limal-branches/mc-devel/limal-ca-mgm/src/X509v3RequestExtensionsImpl.hpp Sat Jul 3 13:27:18 2010
@@ -73,12 +73,12 @@
return new X509v3RequestExtsImpl(*this);
}
- /* String extensions */
+ /* std::string extensions */
NsSslServerNameExt nsSslServerName;
NsCommentExt nsComment;
- /* Bit Strings */
+ /* Bit std::strings */
KeyUsageExt keyUsage;
NsCertTypeExt nsCertType;
Modified: limal-branches/mc-devel/limal-ca-mgm/src/X509v3RequestExtensions_Priv.cpp
URL: http://svn.opensuse.org/viewcvs/limal/limal-branches/mc-devel/limal-ca-mgm/src/X509v3RequestExtensions_Priv.cpp?rev=2675&r1=2674&r2=2675&view=diff
==============================================================================
--- limal-branches/mc-devel/limal-ca-mgm/src/X509v3RequestExtensions_Priv.cpp (original)
+++ limal-branches/mc-devel/limal-ca-mgm/src/X509v3RequestExtensions_Priv.cpp Sat Jul 3 13:27:18 2010
@@ -129,14 +129,14 @@
// extension occurred more than once
LOGIT_ERROR("Extension occurred more than once: " << nid);
BLOCXX_THROW(ca_mgm::SyntaxException,
- Format(__("Extension occurred more than once: %1."),
+ str::form(__("Extension occurred more than once: %1."),
nid).c_str());
}
LOGIT_ERROR("Unable to parse the certificate (NID:" << nid <<
" Crit:" << crit << ")");
BLOCXX_THROW(ca_mgm::SyntaxException,
- Format(__("Unable to parse the certificate (NID: %1 Crit: %2)."),
+ str::form(__("Unable to parse the certificate (NID: %1 Crit: %2)."),
nid, crit).c_str());
}
@@ -184,14 +184,14 @@
// extension occurred more than once
LOGIT_ERROR("Extension occurred more than once: " << nid);
BLOCXX_THROW(ca_mgm::SyntaxException,
- Format(__("Extension occurred more than once: %1."),
+ str::form(__("Extension occurred more than once: %1."),
nid).c_str());
}
LOGIT_ERROR("Unable to parse the certificate (NID:" << nid <<
" Crit:" << crit << ")");
BLOCXX_THROW(ca_mgm::SyntaxException,
- Format(__("Unable to parse the certificate (NID: %1 Crit: %2)."),
+ str::form(__("Unable to parse the certificate (NID: %1 Crit: %2)."),
nid, crit).c_str());
}
@@ -249,7 +249,7 @@
LOGIT_ERROR("Unable to parse the certificate (" << "Crit:" << crit << ")");
BLOCXX_THROW(ca_mgm::SyntaxException,
- Format(__("Unable to parse the certificate (Crit: %1)."),
+ str::form(__("Unable to parse the certificate (Crit: %1)."),
crit).c_str());
}
@@ -269,7 +269,7 @@
}
else
{
- usageList.push_back(String(OBJ_nid2sn(nid)));
+ usageList.push_back(std::string(OBJ_nid2sn(nid)));
}
}
ext.setExtendedKeyUsage(usageList);
@@ -315,7 +315,7 @@
LOGIT_ERROR("Unable to parse the certificate (" << "Crit:" << crit << ")");
BLOCXX_THROW(ca_mgm::SyntaxException,
- Format(__("Unable to parse the certificate (Crit: %1)."),
+ str::form(__("Unable to parse the certificate (Crit: %1)."),
crit).c_str());
}
@@ -379,18 +379,15 @@
LOGIT_ERROR("Unable to parse the certificate (" << "Crit:" << crit << ")");
BLOCXX_THROW(ca_mgm::SyntaxException,
- Format(__("Unable to parse the certificate (Crit: %1)."),
+ str::form(__("Unable to parse the certificate (Crit: %1)."),
crit).c_str());
}
- String s;
+ std::string s;
for(int i = 0; i < ski->length; ++i)
{
- String d;
- d.format("%02x", ski->data[i]);
-
- s += d;
+ s += str::form( "%02x", ski->data[i]);
if( (i+1) < ski->length)
{
s += ":";
@@ -439,7 +436,7 @@
LOGIT_ERROR("Unable to parse the certificate (" << "Crit:" << crit << ")");
BLOCXX_THROW(ca_mgm::SyntaxException,
- Format(__("Unable to parse the certificate (Crit: %1)."),
+ str::form(__("Unable to parse the certificate (Crit: %1)."),
crit).c_str());
}
Modified: limal-branches/mc-devel/limal-ca-mgm/src/limal/Exception.hpp
URL: http://svn.opensuse.org/viewcvs/limal/limal-branches/mc-devel/limal-ca-mgm/src/limal/Exception.hpp?rev=2675&r1=2674&r2=2675&view=diff
==============================================================================
--- limal-branches/mc-devel/limal-ca-mgm/src/limal/Exception.hpp (original)
+++ limal-branches/mc-devel/limal-ca-mgm/src/limal/Exception.hpp Sat Jul 3 13:27:18 2010
@@ -37,7 +37,7 @@
* MY_INVALID_EMAIL_ERROR_NUMBER);
*
* BLOCXX_THROW(ca_mgm::SyntaxException,
- * Format("Syntax error in line %1", 42).c_str());
+ * str::form("Syntax error in line %1", 42).c_str());
*
* try
* {
Modified: limal-branches/mc-devel/limal-ca-mgm/src/limal/Makefile.am
URL: http://svn.opensuse.org/viewcvs/limal/limal-branches/mc-devel/limal-ca-mgm/src/limal/Makefile.am?rev=2675&r1=2674&r2=2675&view=diff
==============================================================================
--- limal-branches/mc-devel/limal-ca-mgm/src/limal/Makefile.am (original)
+++ limal-branches/mc-devel/limal-ca-mgm/src/limal/Makefile.am Sat Jul 3 13:27:18 2010
@@ -23,7 +23,8 @@
Url.hpp \
Date.hpp \
String.hpp \
- PerlRegEx.hpp
+ PerlRegEx.hpp \
+ PosixRegEx.hpp
CLEANFILES = *~
Modified: limal-branches/mc-devel/limal-ca-mgm/src/limal/PathInfo.hpp
URL: http://svn.opensuse.org/viewcvs/limal/limal-branches/mc-devel/limal-ca-mgm/src/limal/PathInfo.hpp?rev=2675&r1=2674&r2=2675&view=diff
==============================================================================
--- limal-branches/mc-devel/limal-ca-mgm/src/limal/PathInfo.hpp (original)
+++ limal-branches/mc-devel/limal-ca-mgm/src/limal/PathInfo.hpp Sat Jul 3 13:27:18 2010
@@ -72,7 +72,7 @@
* @code
* PathInfo pi1( "/foo/bar/some_file"); // new object from c-string
* PathInfo pi2( PathName( "/foo/bar/some_file"); // new object from PathName object
- * PathInfo pi3( blocxx::String( "/foo/bar/some_file" ); // new object from blocxx::String
+ * PathInfo pi3( std::string( "/foo/bar/some_file" ); // new object from std::string
* std::cout << "File: \t\t" << pi1 << std::endl;
* std::cout << "Type: \t\t" << pi1.fileType() << std::endl;
@@ -81,7 +81,7 @@
* std::cout << "#links: \t" << pi1.nlink() << std::endl;
*
* // Note the comment further down on the return value of size()!
- * std::cout << "size: \t\t" << blocxx::String( pi1.size() ) << std::endl;
+ * std::cout << "size: \t\t" << std::string( pi1.size() ) << std::endl;
* std::cout << "blksize: \t" << pi1.blksize() << std::endl;
* std::cout << "blocks: \t" << pi1.blocks() << std::endl;
* std::cout << "dev: \t\t" << pi1.dev() << std::endl;
@@ -166,14 +166,14 @@
PathInfo( const PathName & path = "", Mode initial = E_STAT );
/**
- * @brief Constructor to create a PathInfo object from a blocxx::String.
+ * @brief Constructor to create a PathInfo object from a std::string.
* Initial stat-mode defaults to E_STAT.
*
- * @param path The blocxx::String representing a path which is used
+ * @param path The std::string representing a path which is used
* to create the new PathInfo object.
* @param initial The stat-mode used when performing stat operations.
*/
- PathInfo( const blocxx::String & path, Mode initial = E_STAT );
+ PathInfo( const std::string & path, Mode initial = E_STAT );
/**
* @brief Constructor to create a PathInfo object from a c-string.
@@ -196,12 +196,12 @@
const PathName path() const { return m_path; }
/**
- * @brief Returns a blocxx::String formed from the PathName object this
+ * @brief Returns a std::string formed from the PathName object this
* this PathInfo object holds.
- * @return A blocxx::String created from the PathName object this PathInfo
+ * @return A std::string created from the PathName object this PathInfo
* object holds.
*/
- blocxx::String toString() const { return m_path.toString(); }
+ std::string toString() const { return m_path.toString(); }
/**
* @brief Returns the stat mode which is currently set in this PathInfo
* object.
@@ -627,7 +627,7 @@
* @note The off_t type may be of type "long long" (64bit) and
* the stream operator "<<" may convert off_t to int, causing
* unexpected wrong outputs.
- * You can workaround it using blocxx::String(p.size()), that
+ * You can workaround it using std::string(p.size()), that
* provides proper conversion constructors for 64bit integers.
*/
::off_t size() const;
Modified: limal-branches/mc-devel/limal-ca-mgm/src/limal/PathName.hpp
URL: http://svn.opensuse.org/viewcvs/limal/limal-branches/mc-devel/limal-ca-mgm/src/limal/PathName.hpp?rev=2675&r1=2674&r2=2675&view=diff
==============================================================================
--- limal-branches/mc-devel/limal-ca-mgm/src/limal/PathName.hpp (original)
+++ limal-branches/mc-devel/limal-ca-mgm/src/limal/PathName.hpp Sat Jul 3 13:27:18 2010
@@ -63,7 +63,7 @@
class PathName
{
public:
- typedef std::listblocxx::String List;
+ typedef std::liststd::string List;
/**
* @brief Create an empty PathName object.
@@ -87,12 +87,12 @@
PathName(const PathName::List &list);
/**
- * @brief Create a new PathName object from a blocxx::String.
+ * @brief Create a new PathName object from a std::string.
* @param name The string from which the new PathName object
* shall be created.
* @throws ca_mgm::ValueException
*/
- PathName(const blocxx::String &name);
+ PathName(const std::string &name);
/**
* @brief Create a new PathName object from a c string.
* @param name The character pointer to the c string from which
@@ -130,7 +130,7 @@
*
* @return The complete path this PathName object holds.
*/
- blocxx::String toString() const;
+ std::string toString() const;
/**
* @brief Returns the path this PathName object holds, as
@@ -154,7 +154,7 @@
*
* @return prefix/drive letter or the empty string
*/
- blocxx::String prefix() const;
+ std::string prefix() const;
/**
* @brief Returns true if this PathName object holds an empty path.
@@ -221,7 +221,7 @@
* @endcode
* @return the file name part of the path string
*/
- blocxx::String baseName() const;
+ std::string baseName() const;
/**
* @brief Returns the base name part of <b>path</b>
@@ -237,7 +237,7 @@
* @param path The PathName object you want to inspect
* @return The file name part of the path string
*/
- static blocxx::String baseName(const PathName &path);
+ static std::string baseName(const PathName &path);
/**
* @brief Returns the absolute name of the path string this object holds.
@@ -333,20 +333,20 @@
*
* Use this function to create a new PathName object that consists of
* <b>this</b> PathName object extended by the string <b>ext</b>. Basically it just
- * glues the two strings together and calls PathName( const blocxx::String )
+ * glues the two strings together and calls PathName( const std::string )
* For Example:
*
* @code
* PathName p1("/foo");
- * blocxx::String strExt(".old");
+ * std::string strExt(".old");
* std::cout << p1.extend( strExt ); // == "/foo.old"
* @endcode
*
- * @param ext Reference to a blocxx::String containing the extension.
+ * @param ext Reference to a std::string containing the extension.
* @return A new PathName object that consists of <b>path</b> extended by
* <b>ext</b>.
*/
- PathName extend(const blocxx::String &ext) const;
+ PathName extend(const std::string &ext) const;
/**
* @brief Create a new PathName object by extending <b>path</b> by
@@ -354,22 +354,22 @@
*
* Static function to create a new PathName object that consists of
* <b>path</b> extended by the string <b>ext</b>. Basically it just
- * glues the two strings together and calls PathName( const blocxx::String )
+ * glues the two strings together and calls PathName( const std::string )
* For Example:
*
* @code
* PathName p1("/foo");
- * blocxx::String strExt(".old");
+ * std::string strExt(".old");
* std::cout << PathName::extend(p1, strExt ); // == "/foo.old"
* @endcode
*
* @param path Reference to a PathName object that is to be extended.
- * @param ext Reference to a blocxx::String containing the extension.
+ * @param ext Reference to a std::string containing the extension.
* @return A new PathName object that consists of <b>path</b> extended by
* <b>ext</b>.
*/
static PathName extend(const PathName &path,
- const blocxx::String &ext);
+ const std::string &ext);
/**
* @brief Test for equality of <b>this</b> and <b>rpath</b>.
@@ -403,7 +403,7 @@
* @throws ca_mgm::ValueException
*/
- void assign(const blocxx::String &path);
+ void assign(const std::string &path);
/**
* @brief Assigns <b>list</b> to this PathName objects m_name string.
@@ -423,7 +423,7 @@
* an (optional) drive letter.
*/
size_t m_prefix;
- blocxx::String m_name;
+ std::string m_name;
};
Modified: limal-branches/mc-devel/limal-ca-mgm/src/limal/PathUtils.hpp
URL: http://svn.opensuse.org/viewcvs/limal/limal-branches/mc-devel/limal-ca-mgm/src/limal/PathUtils.hpp?rev=2675&r1=2674&r2=2675&view=diff
==============================================================================
--- limal-branches/mc-devel/limal-ca-mgm/src/limal/PathUtils.hpp (original)
+++ limal-branches/mc-devel/limal-ca-mgm/src/limal/PathUtils.hpp Sat Jul 3 13:27:18 2010
@@ -126,7 +126,7 @@
*
* @return 0 on success, errno on failure.
**/
- int readDir(std::listblocxx::String & retlist,
+ int readDir(std::liststd::string & retlist,
const PathName& path, bool dots);
/**
@@ -167,9 +167,9 @@
int changeMode(const PathName& path, mode_t mode);
/**
- * ??? Or String ???
+ * ??? Or std::string ???
*/
- // int changeOwner(const PathName& path, const String& uid, const String& gid);
+ // int changeOwner(const PathName& path, const std::string& uid, const std::string& gid);
}
}
Added: limal-branches/mc-devel/limal-ca-mgm/src/limal/PosixRegEx.hpp
URL: http://svn.opensuse.org/viewcvs/limal/limal-branches/mc-devel/limal-ca-mgm/src/limal/PosixRegEx.hpp?rev=2675&view=auto
==============================================================================
--- limal-branches/mc-devel/limal-ca-mgm/src/limal/PosixRegEx.hpp (added)
+++ limal-branches/mc-devel/limal-ca-mgm/src/limal/PosixRegEx.hpp Sat Jul 3 13:27:18 2010
@@ -0,0 +1,416 @@
+/*******************************************************************************
+* Copyright (C) 2005 Novell, Inc. All rights reserved.
+*
+* Redistribution and use in source and binary forms, with or without
+* modification, are permitted provided that the following conditions are met:
+*
+* - Redistributions of source code must retain the above copyright notice,
+* this list of conditions and the following disclaimer.
+*
+* - Redistributions in binary form must reproduce the above copyright notice,
+* this list of conditions and the following disclaimer in the documentation
+* and/or other materials provided with the distribution.
+*
+* - Neither the name of Quest Software, Inc., Novell, Inc., nor the names of its
+* contributors may be used to endorse or promote products derived from this
+* software without specific prior written permission.
+*
+* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
+* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+* ARE DISCLAIMED. IN NO EVENT SHALL Quest Software, Inc., Novell, Inc., OR THE
+* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
+* OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
+* WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
+* OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
+* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+*******************************************************************************/
+/**
+ * @author Marius Tomaschewski
+ */
+
+#ifndef LIMAL_POSIX_REGEX_HPP
+#define LIMAL_POSIX_REGEX_HPP
+
+#include
+#include <vector>
+
+#include
+
+namespace ca_mgm
+{
+
+/**
+ * POSIX Regular Expression wrapper class and utility functions.
+ *
+ * Depends on avaliability of a POSIX.2 / SUSv2 conforming
+ * regcomp(3) and regexec(3) function implementation.
+ *
+ * Consult the regcomp(3), regexec(3) and regex(7) manual pages
+ * for informations about details of the posix regex usage.
+ */
+class PosixRegEx
+{
+public:
+ /**
+ * POSIX RegEx structure for captured substring offset pair.
+ * The regex match structure contains two member variables:
+ * @arg @c rm_so start offset of the regex match
+ * @arg @c rm_eo end offset of the regex match
+ */
+ typedef regmatch_t match_t;
+
+ /**
+ * Array of captured substring offsets.
+ */
+ typedef std::vector MatchArray;
+
+ /**
+ * Create a new PosixRegEx object without compilation.
+ */
+ PosixRegEx();
+
+ /**
+ * Create a new PosixRegEx object and compile the regular expression.
+ *
+ * See also compile() method.
+ *
+ * @param regex A regular expression pattern.
+ * @param cflags Bitwise-or of compilation flags.
+ * @throws RegExCompileException on compilation failure.
+ */
+ PosixRegEx(const std::string ®ex, int cflags = REG_EXTENDED);
+
+ /**
+ * Create a new PosixRegEx as (deep) copy of the specified reference.
+ * If the reference is compiled, the new object will be compiled
+ * as well.
+ *
+ * @param ref The PosixRegEx object reference to copy.
+ * @throws RegExCompileException on compilation failure.
+ */
+ PosixRegEx(const PosixRegEx &ref);
+
+ /**
+ * Destroy this PosixRegEx object.
+ */
+ ~PosixRegEx();
+
+ /**
+ * Assign the specified PosixRegEx reference. If the reference
+ * is compiled, the current object will be (re)compiled.
+ *
+ * @param ref The PosixRegEx object reference to assign from.
+ * @throws RegExCompileException on compilation failure.
+ */
+ PosixRegEx& operator = (const PosixRegEx &ref);
+
+
+ /**
+ * Compile the regular expression contained in the string.
+ *
+ * @param regex A regular expression pattern.
+ * @param cflags Bitwise-or of compilation flags.
+ * @return True on successful compilation,
+ * false on failure.
+ *
+ * The @c cflags parameter can be set to one or a bitwise-or
+ * of the following flags. Consult the regcomp manual page
+ * for the complete (library specific) flag list and detailed
+ * description.
+ *
+ * @arg @c REG_EXTENDED Use Extended Regular Expressions
+ * syntax instead of Basic.
+ * @arg @c REG_ICASE Ignore character case in match.
+ * @arg @c REG_NOSUB Report match only, do not capture
+ * substrings.
+ * @arg @c REG_NEWLINE Match-any-character operators
+ * don't match a newline.
+ */
+ bool compile(const std::string ®ex,
+ int cflags = REG_EXTENDED);
+
+ /**
+ * Return the last error code generated by compile or
+ * one of the executing methods.
+ *
+ * @return 0 or the last error code
+ */
+ int errorCode();
+
+ /**
+ * Return the error message string for the last error code.
+ *
+ * @return The error message or empty string
+ * if no expression was compiled.
+ */
+ std::string errorString() const;
+
+
+ /**
+ * @return The regular expression pattern string.
+ */
+ std::string patternString() const;
+
+ /**
+ * @return The compilation flags used in compile() method.
+ */
+ int compileFlags() const;
+
+ /**
+ * @return true, if the current regex object is compiled.
+ */
+ bool isCompiled() const;
+
+
+ /**
+ * Execute regular expression matching against the string.
+ * The matching starts at the specified index and return
+ * true on match of false if no match found.
+ *
+ * @note In contrast to the (PCRE) PerlRegEx class, the index
+ * handling is not provided by posix regex.
+ * The PosixRegEx class is using simple str.c_str() + index
+ * construct and adjusts the resulting match offsets.
+ *
+ * The expected number of substrings to match can be specified
+ * in @c count. If the default value of 0 is used, the count as
+ * detected by compile is used instead.
+ * @note If the specified count is greater 0 but smaller than
+ * the effectively number of found matches, the match array
+ * will contain only offsets for captured substring. This is
+ * a different than in PerlRegEx that reports failure.
+ * If the specified count is greater 0 and greater than the
+ * the effectively number of found matches, unused offsets
+ * at the end are filled with to -1.
+ *
+ * If no match was found, the @c sub array will be empty
+ * and false is returned.
+ * If a match is found and the expression was compiled to
+ * capture substrings, the @c sub array will be filled with
+ * the captured substring offset (match_t structures).
+ * The first (index 0) offset pair points to the start of the
+ * first match and the end of the last match.
+ * Unused / optional capturing subpattern offsets will be set
+ * to -1.
+ *
+ * Consult the regexec(3) and regex(7) manual pages
+ * for complete and detailed descriptions.
+ *
+ * @param sub array for substring offsets
+ * @param str string to match
+ * @param index match string starting at index
+ * @param count number of expected substring matches
+ * @param eflags execution flags described bellow
+ * @return true on match or false
+ * @throws RegExCompileException if regex is not compiled.
+ * @throws OutOfBoundsException if the index is greater
+ * than the string length.
+ *
+ * The @c eflags parameter can be set to 0, one or
+ * a bitwise-or of the following options:
+ *
+ * @arg @c REG_NOTBOL The circumflex character (^) will
+ * not match the beginning of string.
+ * @arg @c REG_NOTEOL The dollar sign ($) will not match
+ * the end of string.
+ *
+ * @par Example:
+ * @code
+ * std::string str("foo = bar trala hoho");
+ * MatchArray sub;
+ * if( PosixRegEx("=").execute(sub, str) && !sub.empty())
+ * {
+ * //
+ * // sub[0].rm_so is 4,
+ * // sub[0].rm_eo is 5
+ * //
+ * }
+ * @endcode
+ */
+ bool execute(MatchArray &sub,
+ const std::string &str,
+ size_t index = 0,
+ size_t count = 0,
+ int eflags = 0);
+
+ /**
+ * Search in string and return an array of captured substrings.
+ *
+ * @param str string to search in
+ * @param index match string starting at index
+ * @param count expected substring count
+ * @param eflags execution flags, see execute() method
+ * @return array of captured substrings
+ * @throws RegExCompileException if regex is not compiled
+ * or the REG_NOSUB compilation flag was used.
+ * @throws RegExExecuteException on execute failures.
+ * @throws OutOfBoundsException if the index is greater
+ * than the string length.
+ *
+ * @par Example:
+ * @code
+ * std::string str("foo = bar trala hoho");
+ * PosixRegEx reg("^([a-z]+)[ \t]*=[ \t]*(.*)$");
+ * std::vectorstd::string out = reg.capture(str);
+ * //
+ * // out is { "foo = bar trala hoho",
+ * // "foo",
+ * // "bar trala hoho"
+ * // }
+ * @endcode
+ */
+ std::vectorstd::string capture(const std::string &str,
+ size_t index = 0,
+ size_t count = 0,
+ int eflags = 0);
+
+ /**
+ * Replace (substitute) the first or all matching substrings.
+ *
+ * Substring(s) matching regular expression are replaced with
+ * the string provided in @c rep and a new, modified string
+ * is returned.
+ * If no matches are found, a copy of 'str' string is returned.
+ *
+ * The rep string can contain capturing references "\\1" to "\\9"
+ * that will be substituted with the corresponding captured string.
+ * Prepended "\\" before the reference disables (switches to skip)
+ * the substitution. Note, the notation using double-slash followed
+ * by a digit character, not just "\1" like the "\n" escape sequence.
+ *
+ * @param str string that should be matched
+ * @param rep replacement substring with optional references
+ * @param global if to replace the first or all matches
+ * @param eflags execution flags, see execute() method
+ * @return new string with modification(s)
+ * @throws RegExCompileException if regex is not compiled
+ * or the REG_NOSUB compilation flag was used.
+ * @throws RegExExecuteException on execute failures.
+ * @throws OutOfBoundsException if the index is greater
+ * than the string length.
+ *
+ * @par Example:
+ * @code
+ * std::string str("//foo/.//bar/hoho");
+ * PosixRegEx reg("([/]+(\\.?[/]+)?)");
+ * std::string out = reg.replace(str, "/", true);
+ * //
+ * // out is "/foo/bar/hoho"
+ * //
+ * @endcode
+ */
+ std::string replace(const std::string &str,
+ const std::string &rep,
+ bool global = false,
+ int eflags = 0);
+
+ /**
+ * Split the specified string into an array of substrings.
+ * The regular expression is used to match the separators.
+ *
+ * If the empty flag is true, empty substring are included
+ * in the resulting array.
+ *
+ * If no separators were found, and the empty flag is true,
+ * the array will contain the input string as its only element.
+ * If the empty flag is false, a empty array is returned.
+ *
+ * @param str string that should be splitted
+ * @param empty whether to capture empty substrings
+ * @param eflags execution flags, see execute() method
+ * @return array of resulting substrings
+ * or empty array on failure
+ * @throws RegExCompileException if regex is not compiled
+ * or the REG_NOSUB compilation flag was used.
+ * @throws RegExExecuteException on execute failures.
+ * @throws OutOfBoundsException if the index is greater
+ * than the string length.
+ *
+ * @par Example:
+ * @code
+ * std::string str("1.23, .50 , , 71.00 , 6.00");
+ * std::vectorstd::string out1 = PosixRegEx("([ \t]*,[ \t]*)").split(str);
+ * //
+ * // out1 is { "1.23", ".50", "71.00", "6.00" }
+ * //
+ * @endcode
+ */
+ std::vectorstd::string split (const std::string &str,
+ bool empty = false,
+ int eflags = 0);
+
+ /**
+ * Match all strings in the array against regular expression.
+ * Returns an array of matching strings.
+ *
+ * @param src list of strings to match
+ * @param eflags execution flags, see execute() method
+ * @throws RegExCompileException if regex is not compiled
+ * or the REG_NOSUB compilation flag was used.
+ * @throws RegExExecuteException on execute failures.
+ * @throws OutOfBoundsException if the index is greater
+ * than the string length.
+ *
+ * @par Example:
+ * @code
+ * std::vectorstd::string src;
+ * src.push_back("\t");
+ * src.push_back("one");
+ * src.push_back("");
+ * src.push_back("two");
+ * src.push_back(" ");
+ * std::vectorstd::string out = PosixRegEx("[^ \t]").grep(src);
+ * //
+ * // out is { "one", "two" }
+ * //
+ * @endcode
+ */
+ std::vectorstd::string grep (const std::vectorstd::string &src,
+ int eflags = 0);
+
+ /**
+ * Execute regular expression matching against the string.
+ * The matching starts at the specified index and return
+ * true on match of false if no match found.
+ *
+ * See execute() method for description of the @c index
+ * and @c eflags parameters.
+ *
+ * @param str string to match
+ * @param index match string starting at index
+ * @param eflags execution flags, see execute() method
+ * @return true on match or false
+ * @throws RegExCompileException if regex is not compiled.
+ * @throws RegExExecuteException on execute failures.
+ * @throws OutOfBoundsException if the index is greater
+ * than the string length.
+ *
+ * @par Example:
+ * @code
+ * std::string str("foo = bar ");
+ * if( PosixRegEx("^[a-z]+[ \t]*=[ \t]*.*$").match(str))
+ * {
+ * }
+ * @endcode
+ */
+ bool match (const std::string &str,
+ size_t index = 0,
+ int eflags = 0) const;
+
+private:
+ bool compiled;
+ int m_flags;
+ mutable int m_ecode;
+ mutable std::string m_error;
+ std::string m_rxstr;
+ regex_t m_regex;
+};
+
+} // End of BLOCXX_NAMESPACE
+
+#endif // LIMAL_POSIX_REGEX_HPP
+/* vim: set ts=8 sts=8 sw=8 ai noet: */
+
Modified: limal-branches/mc-devel/limal-ca-mgm/src/limal/String.hpp
URL: http://svn.opensuse.org/viewcvs/limal/limal-branches/mc-devel/limal-ca-mgm/src/limal/String.hpp?rev=2675&r1=2674&r2=2675&view=diff
==============================================================================
--- limal-branches/mc-devel/limal-ca-mgm/src/limal/String.hpp (original)
+++ limal-branches/mc-devel/limal-ca-mgm/src/limal/String.hpp Sat Jul 3 13:27:18 2010
@@ -11,7 +11,7 @@
| (C) SUSE Linux Products GmbH |
\----------------------------------------------------------------------/
- File: String.hpp
+ File: std::string.hpp
Author: Michael Andres
@@ -24,6 +24,7 @@
#include <iosfwd>
#include <vector>
#include <string>
+#include <iostream>
#include
@@ -108,7 +109,7 @@
{ return str << obj.c_str(); }
///////////////////////////////////////////////////////////////////
- /** String related utilities and \ref ZYPP_STR_REGEX.
+ /** std::string related utilities and \ref ZYPP_STR_REGEX.
\see \ref ZYPP_STR_REGEX
*/
namespace str
@@ -118,6 +119,8 @@
/**
* Global asString() that works with std::string too
*/
+ inline std::string toString( bool b) { return (b?"true":"false"); }
+
template<class _T>
inline std::string asString( const _T &t )
{ return t.asString(); }
@@ -168,7 +171,7 @@
};
///////////////////////////////////////////////////////////////////
- /** \name String representation of number.
+ /** \name std::string representation of number.
*
* Optional second argument sets the minimal string width (' ' padded).
* Negative values will cause the number to be left adjusted within the string.
@@ -194,7 +197,7 @@
//@}
///////////////////////////////////////////////////////////////////
- /** \name String representation of number as hex value with leading '0x'.
+ /** \name std::string representation of number as hex value with leading '0x'.
* Optional second argument sets the minimal
* string width (0 padded). Negative values will cause the number to be left adjusted
* within the string. Default width is 10 (4 for char).
@@ -218,7 +221,7 @@
//@}
///////////////////////////////////////////////////////////////////
- /** \name String representation of number as octal value with leading '0'.
+ /** \name std::string representation of number as octal value with leading '0'.
* Optional second argument sets the minimal
* string width (0 padded). Negative values will cause the number to be left adjusted
* within the string. Default width is 5 (4 for char).
@@ -245,7 +248,7 @@
/** Parsing numbers from string.
*/
//@{
- /** String to integer type determined by template arg.
+ /** std::string to integer type determined by template arg.
* \note Only specializations are defined.
* \code
* time_t t = strtonum( "42" );
@@ -272,7 +275,7 @@
template<>
inline unsigned long long strtonum( const C_Str & str ) { return ::strtoull( str, NULL, 0 ); }
- /** String to integer type detemined 2nd function arg \a i.
+ /** std::string to integer type detemined 2nd function arg \a i.
* \code
* time_t t; strtonum( "42", t );
* \endcode
@@ -387,7 +390,7 @@
*
* \param line_r The string to parse.
* \param result_r
- * \param sepchars_r String of separator characters.
+ * \param sepchars_r std::string of separator characters.
* \param withEmpty Whether to include empty fields between separators in the result.
*
* \endcode
@@ -750,13 +753,16 @@
///////////////////////////////////////////////////////////////////
- /** \name String prefix/suffix handling.
+ /** \name std::string prefix/suffix handling.
*/
//@{
/** Return whether \a str_r has prefix \a prefix_r. */
inline bool hasPrefix( const C_Str & str_r, const C_Str & prefix_r )
{ return( ::strncmp( str_r, prefix_r, prefix_r.size() ) == 0 ); }
+ inline bool hasPrefixCI( const C_Str & str_r, const C_Str & prefix_r )
+ { return( ::strncasecmp( str_r, prefix_r, prefix_r.size() ) == 0 ); }
+
/** Strip a \a prefix_r from \a str_r and return the resulting string. */
inline std::string stripPrefix( const C_Str & str_r, const C_Str & prefix_r )
{ return( hasPrefix( str_r, prefix_r ) ? str_r + prefix_r.size() : str_r.c_str() ); }
@@ -765,6 +771,9 @@
inline bool hasSuffix( const C_Str & str_r, const C_Str & suffix_r )
{ return( str_r.size() >= suffix_r.size() && ::strncmp( str_r + str_r.size() - suffix_r.size() , suffix_r, suffix_r.size() ) == 0 ); }
+ inline bool hasSuffixCI( const C_Str & str_r, const C_Str & suffix_r )
+ { return( str_r.size() >= suffix_r.size() && ::strncasecmp( str_r + str_r.size() - suffix_r.size() , suffix_r, suffix_r.size() ) == 0 ); }
+
/** Strip a \a suffix_r from \a str_r and return the resulting string. */
inline std::string stripSuffix( const C_Str & str_r, const C_Str & suffix_r )
{
@@ -776,10 +785,18 @@
/** alias for \ref hasPrefix */
inline bool startsWith( const C_Str & str_r, const C_Str & prefix_r )
{ return hasPrefix( str_r, prefix_r ); }
+ /** alias for \ref hasPrefixCI */
+ inline bool startsWithCI( const C_Str & str_r, const C_Str & prefix_r )
+ { return hasPrefixCI( str_r, prefix_r ); }
+
/** alias for \ref hasSuffix */
inline bool endsWith( const C_Str & str_r, const C_Str & prefix_r )
{ return hasSuffix( str_r, prefix_r ); }
+
+ inline bool endsWithCI( const C_Str & str_r, const C_Str & prefix_r )
+ { return hasSuffixCI( str_r, prefix_r ); }
//@}
+
/////////////////////////////////////////////////////////////////
} // namespace str
///////////////////////////////////////////////////////////////////
Modified: limal-branches/mc-devel/limal-ca-mgm/src/limal/Url.hpp
URL: http://svn.opensuse.org/viewcvs/limal/limal-branches/mc-devel/limal-ca-mgm/src/limal/Url.hpp?rev=2675&r1=2674&r2=2675&view=diff
==============================================================================
--- limal-branches/mc-devel/limal-ca-mgm/src/limal/Url.hpp (original)
+++ limal-branches/mc-devel/limal-ca-mgm/src/limal/Url.hpp Sat Jul 3 13:27:18 2010
@@ -146,7 +146,7 @@
* \throws url::UrlParsingException if parsing of the url fails
* and may also contain an sub-exception - see parseUrl().
*/
- Url(const blocxx::String &urlString);
+ Url(const std::string &urlString);
// -----------------
@@ -168,7 +168,7 @@
* url::UrlNotSupportedException.
*/
static url::UrlRef
- parseUrl(const blocxx::String &urlString);
+ parseUrl(const std::string &urlString);
// -----------------
@@ -184,7 +184,7 @@
* and may also contain an sub-exception - see parseUrl().
*/
Url&
- operator = (const blocxx::String &urlString);
+ operator = (const std::string &urlString);
/**
@@ -206,7 +206,7 @@
* \brief Returns scheme names known to this object.
* \return An array with scheme names known by this object.
*/
- std::vectorblocxx::String
+ std::vectorstd::string
getKnownSchemes() const;
@@ -225,7 +225,7 @@
* the scheme name is known to the current object.
*/
bool
- isValidScheme(const blocxx::String &scheme) const;
+ isValidScheme(const std::string &scheme) const;
/**
@@ -249,7 +249,7 @@
*
* \return A default string representation of the Url object.
*/
- blocxx::String
+ std::string
toString() const;
/**
@@ -264,7 +264,7 @@
* \param opts A combination of view options.
* \return A string representation of the Url object.
*/
- blocxx::String
+ std::string
toString(const ViewOptions &opts) const;
/**
@@ -276,7 +276,7 @@
*
* \return A complete string representation of the Url object.
*/
- blocxx::String
+ std::string
toCompleteString() const;
@@ -285,7 +285,7 @@
* Returns the scheme name of the URL.
* \return Scheme name of the current Url object.
*/
- blocxx::String
+ std::string
getScheme() const;
@@ -299,7 +299,7 @@
*
* \return The encoded authority component string.
*/
- blocxx::String
+ std::string
getAuthority() const;
/**
@@ -309,7 +309,7 @@
* \throws url::UrlDecodingException if the decoded result string
* would contain a '\\0' character.
*/
- blocxx::String
+ std::string
getUsername(EEncoding eflag = ca_mgm::url::E_DECODED) const;
/**
@@ -319,7 +319,7 @@
* \throws url::UrlDecodingException if the decoded result string
* would contain a '\\0' character.
*/
- blocxx::String
+ std::string
getPassword(EEncoding eflag = ca_mgm::url::E_DECODED) const;
/**
@@ -334,14 +334,14 @@
* \throws url::UrlDecodingException if the decoded result string
* would contain a '\\0' character.
*/
- blocxx::String
+ std::string
getHost(EEncoding eflag = ca_mgm::url::E_DECODED) const;
/**
* Returns the port from the URL authority.
* \return The port sub-component from the URL authority.
*/
- blocxx::String
+ std::string
getPort() const;
@@ -355,7 +355,7 @@
*
* \return The encoded path component of the URL.
*/
- blocxx::String
+ std::string
getPathData() const;
/**
@@ -366,14 +366,14 @@
* \throws url::UrlDecodingException if the decoded result string
* would contain a '\\0' character.
*/
- blocxx::String
+ std::string
getPathName(EEncoding eflag = ca_mgm::url::E_DECODED) const;
/**
* Returns the path parameters from the URL.
* \return The encoded path parameters from the URL.
*/
- blocxx::String
+ std::string
getPathParams() const;
/**
@@ -388,7 +388,7 @@
*
* \return The path parameters splited into an array of substrings.
*/
- std::vectorblocxx::String
+ std::vectorstd::string
getPathParamsArray() const;
/**
@@ -429,8 +429,8 @@
* \throws url::UrlDecodingException if the decoded result string
* would contain a '\\0' character.
*/
- blocxx::String
- getPathParam(const blocxx::String ¶m,
+ std::string
+ getPathParam(const std::string ¶m,
EEncoding eflag = ca_mgm::url::E_DECODED) const;
@@ -444,7 +444,7 @@
*
* \return The encoded query string component of the URL.
*/
- blocxx::String
+ std::string
getQueryString() const;
/**
@@ -460,7 +460,7 @@
*
* \return The query string splited into an array of substrings.
*/
- std::vectorblocxx::String
+ std::vectorstd::string
getQueryStringArray() const;
/**
@@ -500,8 +500,8 @@
* \throws url::UrlDecodingException if the decoded result string
* would contain a '\\0' character.
*/
- blocxx::String
- getQueryParam(const blocxx::String ¶m,
+ std::string
+ getQueryParam(const std::string ¶m,
EEncoding eflag = ca_mgm::url::E_DECODED) const;
@@ -513,7 +513,7 @@
* \throws url::UrlDecodingException if the decoded result string
* would contain a '\\0' character.
*/
- blocxx::String
+ std::string
getFragment(EEncoding eflag = ca_mgm::url::E_DECODED) const;
@@ -525,7 +525,7 @@
* contains an invalid character or is empty.
*/
void
- setScheme(const blocxx::String &scheme);
+ setScheme(const std::string &scheme);
// -----------------
@@ -543,7 +543,7 @@
* \throws url::UrlParsingException if \p authority parsing fails.
*/
void
- setAuthority(const blocxx::String &authority);
+ setAuthority(const std::string &authority);
/**
* \brief Set the username in the URL authority.
@@ -555,7 +555,7 @@
* contains an invalid character.
*/
void
- setUsername(const blocxx::String &user,
+ setUsername(const std::string &user,
EEncoding eflag = ca_mgm::url::E_DECODED);
/**
@@ -568,7 +568,7 @@
* contains an invalid character.
*/
void
- setPassword(const blocxx::String &pass,
+ setPassword(const std::string &pass,
EEncoding eflag = ca_mgm::url::E_DECODED);
/**
@@ -592,7 +592,7 @@
* \throws url::UrlBadComponentException if the \p host is invalid.
*/
void
- setHost(const blocxx::String &host,
+ setHost(const std::string &host,
EEncoding eflag = ca_mgm::url::E_DECODED);
/**
@@ -603,7 +603,7 @@
* \throws url::UrlBadComponentException if the \p port is invalid.
*/
void
- setPort(const blocxx::String &port);
+ setPort(const std::string &port);
// -----------------
@@ -618,7 +618,7 @@
* contains an invalid character.
*/
void
- setPathData(const blocxx::String &pathdata);
+ setPathData(const std::string &pathdata);
/**
* \brief Set the path name.
@@ -628,7 +628,7 @@
* contains an invalid character.
*/
void
- setPathName(const blocxx::String &path,
+ setPathName(const std::string &path,
EEncoding eflag = ca_mgm::url::E_DECODED);
/**
@@ -638,7 +638,7 @@
* contains an invalid character.
*/
void
- setPathParams(const blocxx::String ¶ms);
+ setPathParams(const std::string ¶ms);
/**
* \brief Set the path parameters.
@@ -647,7 +647,7 @@
* contains an invalid character.
*/
void
- setPathParamsArray(const std::vectorblocxx::String &parray);
+ setPathParamsArray(const std::vectorstd::string &parray);
/**
* \brief Set the path parameters.
@@ -668,7 +668,7 @@
* would contain a '\\0' character.
*/
void
- setPathParam(const blocxx::String ¶m, const blocxx::String &value);
+ setPathParam(const std::string ¶m, const std::string &value);
// -----------------
@@ -679,7 +679,7 @@
* contains an invalid character.
*/
void
- setQueryString(const blocxx::String &querystr);
+ setQueryString(const std::string &querystr);
/**
* \brief Set the query parameters.
@@ -688,7 +688,7 @@
* contains an invalid character.
*/
void
- setQueryStringArray(const std::vectorblocxx::String &qarray);
+ setQueryStringArray(const std::vectorstd::string &qarray);
/**
* \brief Set the query parameters.
@@ -709,7 +709,7 @@
* would contain a '\\0' character.
*/
void
- setQueryParam(const blocxx::String ¶m, const blocxx::String &value);
+ setQueryParam(const std::string ¶m, const std::string &value);
// -----------------
@@ -721,7 +721,7 @@
* contains an invalid character.
*/
void
- setFragment(const blocxx::String &fragment,
+ setFragment(const std::string &fragment,
EEncoding eflag = ca_mgm::url::E_DECODED);
Modified: limal-branches/mc-devel/limal-ca-mgm/src/limal/UrlBase.hpp
URL: http://svn.opensuse.org/viewcvs/limal/limal-branches/mc-devel/limal-ca-mgm/src/limal/UrlBase.hpp?rev=2675&r1=2674&r2=2675&view=diff
==============================================================================
--- limal-branches/mc-devel/limal-ca-mgm/src/limal/UrlBase.hpp (original)
+++ limal-branches/mc-devel/limal-ca-mgm/src/limal/UrlBase.hpp Sat Jul 3 13:27:18 2010
@@ -355,7 +355,7 @@
* \throws url::UrlBadComponentException if one of the components
* contains an invalid character.
*/
- UrlBase(const blocxx::String &urlString);
+ UrlBase(const std::string &urlString);
// -----------------
@@ -388,7 +388,7 @@
* contains an invalid character.
*/
UrlBase&
- operator = (const blocxx::String &urlString);
+ operator = (const std::string &urlString);
// -----------------
@@ -443,7 +443,7 @@
*
* \return An array with scheme names known by this object.
*/
- virtual std::vectorblocxx::String
+ virtual std::vectorstd::string
getKnownSchemes() const;
/**
@@ -451,7 +451,7 @@
* \return True, if scheme name is known to this object.
*/
virtual bool
- isKnownScheme(const blocxx::String &scheme) const;
+ isKnownScheme(const std::string &scheme) const;
/**
@@ -467,7 +467,7 @@
* the scheme name is known to the current object.
*/
virtual bool
- isValidScheme(const blocxx::String &scheme) const;
+ isValidScheme(const std::string &scheme) const;
/**
* \brief Verifies the Url.
@@ -490,7 +490,7 @@
*
* \return A default string representation of the Url object.
*/
- virtual blocxx::String
+ virtual std::string
toString() const;
/**
@@ -505,7 +505,7 @@
* \param opts A combination of view options.
* \return A string representation of the Url object.
*/
- virtual blocxx::String
+ virtual std::string
toString(const ca_mgm::url::ViewOptions &opts) const;
@@ -514,7 +514,7 @@
* Returns the scheme name of the URL.
* \return Scheme name of the current Url object.
*/
- virtual blocxx::String
+ virtual std::string
getScheme() const;
@@ -528,7 +528,7 @@
*
* \return The encoded authority component string.
*/
- virtual blocxx::String
+ virtual std::string
getAuthority() const;
/**
@@ -538,7 +538,7 @@
* \throws UrlDecodingException if the decoded result string
* would contain a '\\0' character.
*/
- virtual blocxx::String
+ virtual std::string
getUsername(EEncoding eflag) const;
/**
@@ -548,7 +548,7 @@
* \throws UrlDecodingException if the decoded result string
* would contain a '\\0' character.
*/
- virtual blocxx::String
+ virtual std::string
getPassword(EEncoding eflag) const;
/**
@@ -563,14 +563,14 @@
* \throws UrlDecodingException if the decoded result string
* would contain a '\\0' character.
*/
- virtual blocxx::String
+ virtual std::string
getHost(EEncoding eflag) const;
/**
* Returns the port number from the URL authority.
* \return The port sub-component from the URL authority.
*/
- virtual blocxx::String
+ virtual std::string
getPort() const;
@@ -584,7 +584,7 @@
*
* \return The encoded path component of the URL.
*/
- virtual blocxx::String
+ virtual std::string
getPathData() const;
/**
@@ -595,14 +595,14 @@
* \throws UrlDecodingException if the decoded result string
* would contain a '\\0' character.
*/
- virtual blocxx::String
+ virtual std::string
getPathName(EEncoding eflag) const;
/**
* Returns the encoded path parameters from the URL.
* \return The encoded path parameters from the URL.
*/
- virtual blocxx::String
+ virtual std::string
getPathParams() const;
/**
@@ -617,7 +617,7 @@
*
* \return The encoded path parameters array.
*/
- virtual std::vectorblocxx::String
+ virtual std::vectorstd::string
getPathParamsArray() const;
/**
@@ -658,8 +658,8 @@
* \throws UrlDecodingException if the decoded result string
* would contain a '\\0' character.
*/
- virtual blocxx::String
- getPathParam(const blocxx::String ¶m, EEncoding eflag) const;
+ virtual std::string
+ getPathParam(const std::string ¶m, EEncoding eflag) const;
// -----------------
@@ -672,7 +672,7 @@
*
* \return The encoded query string component of the URL.
*/
- virtual blocxx::String
+ virtual std::string
getQueryString() const;
/**
@@ -688,7 +688,7 @@
*
* \return The query string splited into an array of substrings.
*/
- virtual std::vectorblocxx::String
+ virtual std::vectorstd::string
getQueryStringArray() const;
/**
@@ -728,8 +728,8 @@
* \throws UrlDecodingException if the decoded result string
* would contain a '\\0' character.
*/
- virtual blocxx::String
- getQueryParam(const blocxx::String ¶m, EEncoding eflag) const;
+ virtual std::string
+ getQueryParam(const std::string ¶m, EEncoding eflag) const;
// -----------------
@@ -740,7 +740,7 @@
* \throws UrlDecodingException if the decoded result string
* would contain a '\\0' character.
*/
- virtual blocxx::String
+ virtual std::string
getFragment(EEncoding eflag) const;
@@ -752,7 +752,7 @@
* contains an invalid character or is empty.
*/
virtual void
- setScheme(const blocxx::String &scheme);
+ setScheme(const std::string &scheme);
// -----------------
@@ -770,7 +770,7 @@
* \throws UrlParsingException if \p authority parsing fails.
*/
virtual void
- setAuthority(const blocxx::String &authority);
+ setAuthority(const std::string &authority);
/**
* \brief Set the username in the URL authority.
@@ -782,7 +782,7 @@
* contains an invalid character.
*/
virtual void
- setUsername(const blocxx::String &user,
+ setUsername(const std::string &user,
EEncoding eflag);
/**
@@ -795,7 +795,7 @@
* contains an invalid character.
*/
virtual void
- setPassword(const blocxx::String &pass,
+ setPassword(const std::string &pass,
EEncoding eflag);
/**
@@ -819,7 +819,7 @@
* \throws UrlBadComponentException if the \p host is invalid.
*/
virtual void
- setHost(const blocxx::String &host,
+ setHost(const std::string &host,
EEncoding eflag);
/**
@@ -830,7 +830,7 @@
* \throws UrlBadComponentException if the \p port is invalid.
*/
virtual void
- setPort(const blocxx::String &port);
+ setPort(const std::string &port);
// -----------------
@@ -845,7 +845,7 @@
* contains an invalid character.
*/
virtual void
- setPathData(const blocxx::String &pathdata);
+ setPathData(const std::string &pathdata);
/**
* \brief Set the path name.
@@ -855,7 +855,7 @@
* contains an invalid character.
*/
virtual void
- setPathName(const blocxx::String &path,
+ setPathName(const std::string &path,
EEncoding eflag);
/**
@@ -865,7 +865,7 @@
* contains an invalid character.
*/
virtual void
- setPathParams(const blocxx::String ¶ms);
+ setPathParams(const std::string ¶ms);
/**
* \brief Set the path parameters.
@@ -874,7 +874,7 @@
* contains an invalid character.
*/
virtual void
- setPathParamsArray(const std::vectorblocxx::String &parray);
+ setPathParamsArray(const std::vectorstd::string &parray);
/**
* \brief Set the path parameters.
@@ -895,7 +895,7 @@
* would contain a '\\0' character.
*/
virtual void
- setPathParam(const blocxx::String ¶m, const blocxx::String &value);
+ setPathParam(const std::string ¶m, const std::string &value);
// -----------------
@@ -912,7 +912,7 @@
* contains an invalid character.
*/
virtual void
- setQueryString(const blocxx::String &querystr);
+ setQueryString(const std::string &querystr);
/**
* \brief Set the query parameters.
@@ -921,7 +921,7 @@
* contains an invalid character.
*/
virtual void
- setQueryStringArray(const std::vectorblocxx::String &qarray);
+ setQueryStringArray(const std::vectorstd::string &qarray);
/**
* \brief Set the query parameters.
@@ -942,7 +942,7 @@
* would contain a '\\0' character.
*/
virtual void
- setQueryParam(const blocxx::String ¶m, const blocxx::String &value);
+ setQueryParam(const std::string ¶m, const std::string &value);
// -----------------
@@ -954,7 +954,7 @@
* contains an invalid character.
*/
virtual void
- setFragment(const blocxx::String &fragment,
+ setFragment(const std::string &fragment,
EEncoding eflag);
@@ -1028,8 +1028,8 @@
* \return The value of the specified variable
* or empty string.
*/
- blocxx::String
- config(const blocxx::String &opt) const;
+ std::string
+ config(const std::string &opt) const;
/**
* Set the value of a UrlBase configuration variable.
@@ -1041,7 +1041,7 @@
* \param val The new value for the configuration variable.
*/
void
- config(const blocxx::String &opt, const blocxx::String &val);
+ config(const std::string &opt, const std::string &val);
/**
@@ -1094,8 +1094,8 @@
* \param authority Whether the url contains authority or not.
* \return A modified encoded path.
*/
- virtual blocxx::String
- cleanupPathName(const blocxx::String &path, bool authority) const;
+ virtual std::string
+ cleanupPathName(const std::string &path, bool authority) const;
/**
* Utility method to cleanup an encoded path name.
@@ -1107,17 +1107,17 @@
* \param path The encoded path name to cleanup.
* \return A modified encoded path.
*/
- virtual blocxx::String
- cleanupPathName(const blocxx::String &path) const;
+ virtual std::string
+ cleanupPathName(const std::string &path) const;
virtual void
- checkValidScheme(const blocxx::String &scheme, EEncoding eflag) const;
+ checkValidScheme(const std::string &scheme, EEncoding eflag) const;
virtual void
- checkValidUser(const blocxx::String &user, EEncoding eflag) const;
+ checkValidUser(const std::string &user, EEncoding eflag) const;
virtual void
- checkValidPass(const blocxx::String &pass, EEncoding eflag) const;
+ checkValidPass(const std::string &pass, EEncoding eflag) const;
/**
* \brief Verifies specified host or IP.
@@ -1143,7 +1143,7 @@
* \throws UrlBadComponentException if the hostname is invalid.
*/
virtual void
- checkValidHost(const blocxx::String &host, EEncoding eflag) const;
+ checkValidHost(const std::string &host, EEncoding eflag) const;
/**
* \brief Verifies if specified port number is in the range 0..65535.
@@ -1152,19 +1152,19 @@
* \throws UrlBadComponentException if the port number is invalid.
*/
virtual void
- checkValidPort(const blocxx::String &port, EEncoding eflag) const;
+ checkValidPort(const std::string &port, EEncoding eflag) const;
virtual void
- checkValidPathName(const blocxx::String &path, EEncoding eflag) const;
+ checkValidPathName(const std::string &path, EEncoding eflag) const;
virtual void
- checkValidPathParams(const blocxx::String ¶ms, EEncoding eflag) const;
+ checkValidPathParams(const std::string ¶ms, EEncoding eflag) const;
virtual void
- checkValidQueryStr(const blocxx::String &querystr, EEncoding eflag) const;
+ checkValidQueryStr(const std::string &querystr, EEncoding eflag) const;
virtual void
- checkValidFragment(const blocxx::String &fragment, EEncoding eflag) const;
+ checkValidFragment(const std::string &fragment, EEncoding eflag) const;
private:
blocxx::COWReference<UrlBaseData> m_data;
Modified: limal-branches/mc-devel/limal-ca-mgm/src/limal/UrlUtils.hpp
URL: http://svn.opensuse.org/viewcvs/limal/limal-branches/mc-devel/limal-ca-mgm/src/limal/UrlUtils.hpp?rev=2675&r1=2674&r2=2675&view=diff
==============================================================================
--- limal-branches/mc-devel/limal-ca-mgm/src/limal/UrlUtils.hpp (original)
+++ limal-branches/mc-devel/limal-ca-mgm/src/limal/UrlUtils.hpp Sat Jul 3 13:27:18 2010
@@ -92,7 +92,7 @@
* A string map, containing key and value pairs parsed from a
* PathParam- or Query-String.
*/
-typedef std::mapblocxx::String,blocxx::String ParamMap;
+typedef std::mapstd::string,std::string ParamMap;
// -------------------------------------------------------------------
@@ -101,11 +101,11 @@
*/
struct UrlComponents
{
- blocxx::String scheme;
- blocxx::String authority;
- blocxx::String pathdata;
- blocxx::String querystr;
- blocxx::String fragment;
+ std::string scheme;
+ std::string authority;
+ std::string pathdata;
+ std::string querystr;
+ std::string fragment;
bool has_scheme;
bool has_authority;
bool has_querystr;
@@ -119,10 +119,10 @@
*/
struct UrlAuthority
{
- blocxx::String user;
- blocxx::String pass;
- blocxx::String host;
- blocxx::String port;
+ std::string user;
+ std::string pass;
+ std::string host;
+ std::string port;
bool has_user;
bool has_pass;
bool has_port;
@@ -164,9 +164,9 @@
* @param eflag If to detect and skip already encoded substrings.
* @return A percent encoded string.
*/
-blocxx::String
-encode(const blocxx::String &str,
- const blocxx::String &safe = "",
+std::string
+encode(const std::string &str,
+ const std::string &safe = "",
ca_mgm::url::EEncoding eflag = E_DECODED);
@@ -181,9 +181,9 @@
* @param eflag If to detect and skip already encoded substrings.
* @return A percent encoded string.
*/
-blocxx::String
+std::string
encode_buf(const ca_mgm::ByteBuffer &buf,
- const blocxx::String &safe = "",
+ const std::string &safe = "",
ca_mgm::url::EEncoding eflag = E_DECODED);
@@ -201,8 +201,8 @@
* @return A decoded strig.
* @throws UrlDecodingException if @p str contains encoded NUL byte.
*/
-blocxx::String
-decode(const blocxx::String &str);
+std::string
+decode(const std::string &str);
// -------------------------------------------------------------------
@@ -222,7 +222,7 @@
* encoded NUL byte (@c "%00").
*/
ca_mgm::ByteBuffer
-decode_buf(const blocxx::String &str, bool allowNUL);
+decode_buf(const std::string &str, bool allowNUL);
// -------------------------------------------------------------------
@@ -235,7 +235,7 @@
* @return A percent encoded representation of the character,
* e.g. %20 for a ' ' (space).
*/
-blocxx::String
+std::string
encode_octet(const unsigned char c);
@@ -276,9 +276,9 @@
* @return The resulting parameter array.
* @throws UrlNotSupportedException if @p psep separator is empty.
*/
-std::vectorblocxx::String
-split(const blocxx::String &pstr,
- const blocxx::String &psep);
+std::vectorstd::string
+split(const std::string &pstr,
+ const std::string &psep);
// -------------------------------------------------------------------
@@ -310,9 +310,9 @@
* is empty.
*/
ca_mgm::url::ParamMap
-split(const blocxx::String &pstr,
- const blocxx::String &psep,
- const blocxx::String &vsep,
+split(const std::string &pstr,
+ const std::string &psep,
+ const std::string &vsep,
EEncoding eflag = E_ENCODED);
@@ -330,9 +330,9 @@
* @param psep Parameter separator character to use.
* @return A parameter string.
*/
-blocxx::String
-join(const std::vectorblocxx::String &parr,
- const blocxx::String &psep);
+std::string
+join(const std::vectorstd::string &parr,
+ const std::string &psep);
// -------------------------------------------------------------------
@@ -357,11 +357,11 @@
* @throws UrlNotSupportedException if @p psep or @p vsep separator
* is empty.
*/
-blocxx::String
+std::string
join(const ca_mgm::url::ParamMap &pmap,
- const blocxx::String &psep,
- const blocxx::String &vsep,
- const blocxx::String &safe);
+ const std::string &psep,
+ const std::string &vsep,
+ const std::string &safe);
// -------------------------------------------------------------------
@@ -371,7 +371,7 @@
* @returns An url components structure.
*/
UrlComponents
-parse_url_string(const blocxx::String &url);
+parse_url_string(const std::string &url);
// -------------------------------------------------------------------
@@ -381,7 +381,7 @@
* @returns An string array containing authority components.
*/
UrlAuthority
-parse_url_authority(const blocxx::String &authority);
+parse_url_authority(const std::string &authority);
// -------------------------------------------------------------------
Modified: limal-branches/mc-devel/limal-ca-mgm/src/limal/ValueCheck.hpp
URL: http://svn.opensuse.org/viewcvs/limal/limal-branches/mc-devel/limal-ca-mgm/src/limal/ValueCheck.hpp?rev=2675&r1=2674&r2=2675&view=diff
==============================================================================
--- limal-branches/mc-devel/limal-ca-mgm/src/limal/ValueCheck.hpp (original)
+++ limal-branches/mc-devel/limal-ca-mgm/src/limal/ValueCheck.hpp Sat Jul 3 13:27:18 2010
@@ -81,7 +81,7 @@
* @return The boolean result of the check.
*/
virtual bool
- isValid(const blocxx::String &value) const = 0;
+ isValid(const std::string &value) const = 0;
/**
* Returns a string explaining / showing the check.
@@ -90,7 +90,7 @@
* whether the value (e.g. @c "2") is lower than @c 5,
* implement it as:
* @code
- * return blocxx::Format("MyCheck('%1' < 5)", value);
+ * return str::form("MyCheck('%1' < 5)", value);
* @endcode
*
* The resulting string will be @c "MyCheck('2' < 5)"
@@ -99,8 +99,8 @@
* @param value The value to evaluate.
* @return A string showing the check.
*/
- virtual blocxx::String
- explain(const blocxx::String &value) const = 0;
+ virtual std::string
+ explain(const std::string &value) const = 0;
protected:
/**
@@ -239,7 +239,7 @@
* @return The boolean result of the check.
*/
virtual bool
- isValid(const blocxx::String &value) const;
+ isValid(const std::string &value) const;
/**
* Returns a string explaining / showing the checks that
@@ -248,8 +248,8 @@
* @param value A string value.
* @return A string showing the check (list).
*/
- virtual blocxx::String
- explain(const blocxx::String &value) const;
+ virtual std::string
+ explain(const std::string &value) const;
/**
* Append a sub-expression to the list of checks
Modified: limal-branches/mc-devel/limal-ca-mgm/src/limal/ValueIntCheck.hpp
URL: http://svn.opensuse.org/viewcvs/limal/limal-branches/mc-devel/limal-ca-mgm/src/limal/ValueIntCheck.hpp?rev=2675&r1=2674&r2=2675&view=diff
==============================================================================
--- limal-branches/mc-devel/limal-ca-mgm/src/limal/ValueIntCheck.hpp (original)
+++ limal-branches/mc-devel/limal-ca-mgm/src/limal/ValueIntCheck.hpp Sat Jul 3 13:27:18 2010
@@ -108,11 +108,11 @@
*
* @param value A string value.
* @return true, if the value fits into the range.
- * @throws blocxx::StringConversionException if the
+ * @throws std::stringConversionException if the
* value can't be converted to a integer value.
*/
virtual bool
- isValid(const blocxx::String &value) const;
+ isValid(const std::string &value) const;
/**
* Return a string showing the integer range check.
@@ -120,8 +120,8 @@
* @param value A string value.
* @return A string showing the check.
*/
- virtual blocxx::String
- explain(const blocxx::String &value) const;
+ virtual std::string
+ explain(const std::string &value) const;
private:
bool m_sign;
Modified: limal-branches/mc-devel/limal-ca-mgm/src/limal/ValuePerlRECheck.hpp
URL: http://svn.opensuse.org/viewcvs/limal/limal-branches/mc-devel/limal-ca-mgm/src/limal/ValuePerlRECheck.hpp?rev=2675&r1=2674&r2=2675&view=diff
==============================================================================
--- limal-branches/mc-devel/limal-ca-mgm/src/limal/ValuePerlRECheck.hpp (original)
+++ limal-branches/mc-devel/limal-ca-mgm/src/limal/ValuePerlRECheck.hpp Sat Jul 3 13:27:18 2010
@@ -30,14 +30,13 @@
#include
#include
-#include
-#include
+#include
+#include
namespace LIMAL_NAMESPACE
{
// -------------------------------------------------------------------
-#ifdef BLOCXX_HAVE_PCRE
/**
* @brief Perl regex value check.
*
@@ -59,7 +58,7 @@
* @throws blocxx::RegExCompileException on invalid pattern
* or enabled utf8 mode with pcre that does not support it.
*/
- ValuePerlRECheck(const blocxx::String ®ex,
+ ValuePerlRECheck(const std::string ®ex,
bool icase = false,
bool utf8 = false);
@@ -72,7 +71,7 @@
* @throws blocxx::RegExExecuteException on execute failure.
*/
virtual bool
- isValid(const blocxx::String &value) const;
+ isValid(const std::string &value) const;
/**
* Return a string showing the regex matching the
@@ -81,16 +80,12 @@
* @param value A string value.
* @return A string showing the check.
*/
- virtual blocxx::String
- explain(const blocxx::String &value) const;
+ virtual std::string
+ explain(const std::string &value) const;
private:
- blocxx::PerlRegEx m_reg;
+ PerlRegEx m_reg;
};
-#else
-#warning PerlRegEx is not avaliable in blocxx
-#endif
-
} // End of LIMAL_NAMESPACE
#endif // LIMAL_VALUE_PERL_REGEX_CHECK_HPP
Modified: limal-branches/mc-devel/limal-ca-mgm/src/limal/ValuePosixRECheck.hpp
URL: http://svn.opensuse.org/viewcvs/limal/limal-branches/mc-devel/limal-ca-mgm/src/limal/ValuePosixRECheck.hpp?rev=2675&r1=2674&r2=2675&view=diff
==============================================================================
--- limal-branches/mc-devel/limal-ca-mgm/src/limal/ValuePosixRECheck.hpp (original)
+++ limal-branches/mc-devel/limal-ca-mgm/src/limal/ValuePosixRECheck.hpp Sat Jul 3 13:27:18 2010
@@ -29,15 +29,14 @@
#include
#include
-#include
-#include
-#include
+#include
+#include
+#include
namespace LIMAL_NAMESPACE
{
// -------------------------------------------------------------------
-#ifdef BLOCXX_HAVE_REGEX
/**
* @brief Posix regex value check.
*
@@ -57,7 +56,7 @@
* @param icase Match case insensitive.
* @throws blocxx::RegExCompileException on invalid pattern
*/
- ValuePosixRECheck(const blocxx::String ®ex,
+ ValuePosixRECheck(const std::string ®ex,
bool icase = false);
/**
@@ -69,7 +68,7 @@
* @throws blocxx::RegExExecuteException on execute failure.
*/
virtual bool
- isValid(const blocxx::String &value) const;
+ isValid(const std::string &value) const;
/**
* Return a string showing the regex matching the
@@ -78,16 +77,12 @@
* @param value A string value.
* @return A string showing the check.
*/
- virtual blocxx::String
- explain(const blocxx::String &value) const;
+ virtual std::string
+ explain(const std::string &value) const;
private:
- blocxx::PosixRegEx m_reg;
+ PosixRegEx m_reg;
};
-#else
-#warning PosixRegEx is not avaliable in blocxx
-#endif
-
} // End of LIMAL_NAMESPACE
#endif // LIMAL_VALUE_POSIX_REGEX_CHECK_HPP
Modified: limal-branches/mc-devel/limal-ca-mgm/src/limal/ca-mgm/AuthorityInfoAccessExtension.hpp
URL: http://svn.opensuse.org/viewcvs/limal/limal-branches/mc-devel/limal-ca-mgm/src/limal/ca-mgm/AuthorityInfoAccessExtension.hpp?rev=2675&r1=2674&r2=2675&view=diff
==============================================================================
--- limal-branches/mc-devel/limal-ca-mgm/src/limal/ca-mgm/AuthorityInfoAccessExtension.hpp (original)
+++ limal-branches/mc-devel/limal-ca-mgm/src/limal/ca-mgm/AuthorityInfoAccessExtension.hpp Sat Jul 3 13:27:18 2010
@@ -34,7 +34,7 @@
class CAConfig;
class AuthorityInformationImpl;
class AuthorityInfoAccessExtImpl;
-
+
class AuthorityInformation {
public:
@@ -57,7 +57,7 @@
* @param location location of the information
*
*/
- AuthorityInformation(const String &accessOID,
+ AuthorityInformation(const std::string &accessOID,
const LiteralValue& location);
/**
@@ -69,14 +69,14 @@
* Destructor
*/
~AuthorityInformation();
-
+
#ifndef SWIG
AuthorityInformation&
operator=(const AuthorityInformation& ai);
#endif
-
+
/**
* Set new Authority Informations
*
@@ -85,13 +85,13 @@
*
*/
void
- setAuthorityInformation(const String &accessOID,
+ setAuthorityInformation(const std::string &accessOID,
const LiteralValue& location);
/**
* Return the access OID
*/
- String
+ std::string
getAccessOID() const;
/**
@@ -115,25 +115,25 @@
* @return Array with error messages. If this Array is empty this
* object is valid
*/
- std::vector<String>
+ std::vectorstd::string
verify() const;
/**
* Return the content of this object for debugging
*/
- std::vector<String>
+ std::vectorstd::string
dump() const;
#ifndef SWIG
friend bool
operator==(const AuthorityInformation &l, const AuthorityInformation &r);
-
+
friend bool
operator<(const AuthorityInformation &l, const AuthorityInformation &r);
#endif
-
+
private:
blocxx::COWIntrusiveReference<AuthorityInformationImpl> m_impl;
@@ -183,7 +183,7 @@
operator=(const AuthorityInfoAccessExt& extension);
#endif
-
+
/**
* Set a new list of Authority Informations
*/
@@ -211,7 +211,7 @@
* @return true if this object is valid, otherwise false
*/
virtual bool
- valid() const;
+ valid() const;
/**
* Verify this object and return an Array with all
@@ -220,18 +220,18 @@
* @return Array with error messages. If this Array is empty this
* object is valid
*/
- virtual std::vectorblocxx::String
+ virtual std::vectorstd::string
verify() const;
/**
* Return the content of this object for debugging
*/
- virtual std::vectorblocxx::String
+ virtual std::vectorstd::string
dump() const;
private:
blocxx::COWIntrusiveReference<AuthorityInfoAccessExtImpl> m_impl;
-
+
};
}
Modified: limal-branches/mc-devel/limal-ca-mgm/src/limal/ca-mgm/AuthorityKeyIdentifierExtension.hpp
URL: http://svn.opensuse.org/viewcvs/limal/limal-branches/mc-devel/limal-ca-mgm/src/limal/ca-mgm/AuthorityKeyIdentifierExtension.hpp?rev=2675&r1=2674&r2=2675&view=diff
==============================================================================
--- limal-branches/mc-devel/limal-ca-mgm/src/limal/ca-mgm/AuthorityKeyIdentifierExtension.hpp (original)
+++ limal-branches/mc-devel/limal-ca-mgm/src/limal/ca-mgm/AuthorityKeyIdentifierExtension.hpp Sat Jul 3 13:27:18 2010
@@ -30,7 +30,7 @@
namespace CA_MGM_NAMESPACE {
class AuthorityKeyIdentifierExtImpl;
-
+
class AuthorityKeyIdentifierExt : public ExtensionBase {
public:
@@ -44,23 +44,23 @@
operator=(const AuthorityKeyIdentifierExt& extension);
#endif
-
+
/**
* Return the key ID of the Authority
*/
- String
+ std::string
getKeyID() const;
/**
* Return the DirName of the Authority
*/
- String
+ std::string
getDirName() const;
/**
* Return the serial number of the Authority
*/
- String
+ std::string
getSerial() const;
/**
@@ -69,7 +69,7 @@
* @return true if this object is valid, otherwise false
*/
virtual bool
- valid() const;
+ valid() const;
/**
* Verify this object and return an Array with all
@@ -78,26 +78,26 @@
* @return Array with error messages. If this Array is empty this
* object is valid
*/
- virtual std::vectorblocxx::String
- verify() const;
-
+ virtual std::vectorstd::string
+ verify() const;
+
/**
* Return the content of this object for debugging
*/
- virtual std::vectorblocxx::String
+ virtual std::vectorstd::string
dump() const;
protected:
blocxx::COWIntrusiveReference<AuthorityKeyIdentifierExtImpl> m_impl;
-
+
void
- setKeyID(const String& kid);
-
+ setKeyID(const std::string& kid);
+
void
- setDirName(const String& dirName);
-
+ setDirName(const std::string& dirName);
+
void
- setSerial(const String& serial);
+ setSerial(const std::string& serial);
private:
virtual void commit2Config(CA& ca, Type type) const;
Modified: limal-branches/mc-devel/limal-ca-mgm/src/limal/ca-mgm/AuthorityKeyIdentifierGenerateExtension.hpp
URL: http://svn.opensuse.org/viewcvs/limal/limal-branches/mc-devel/limal-ca-mgm/src/limal/ca-mgm/AuthorityKeyIdentifierGenerateExtension.hpp?rev=2675&r1=2674&r2=2675&view=diff
==============================================================================
--- limal-branches/mc-devel/limal-ca-mgm/src/limal/ca-mgm/AuthorityKeyIdentifierGenerateExtension.hpp (original)
+++ limal-branches/mc-devel/limal-ca-mgm/src/limal/ca-mgm/AuthorityKeyIdentifierGenerateExtension.hpp Sat Jul 3 13:27:18 2010
@@ -119,13 +119,13 @@
* @return Array with error messages. If this Array is empty this
* object is valid
*/
- virtual std::vectorblocxx::String
+ virtual std::vectorstd::string
verify() const;
/**
* Return the content of this object for debugging
*/
- virtual std::vectorblocxx::String
+ virtual std::vectorstd::string
dump() const;
private:
Modified: limal-branches/mc-devel/limal-ca-mgm/src/limal/ca-mgm/BasicConstraintsExtension.hpp
URL: http://svn.opensuse.org/viewcvs/limal/limal-branches/mc-devel/limal-ca-mgm/src/limal/ca-mgm/BasicConstraintsExtension.hpp?rev=2675&r1=2674&r2=2675&view=diff
==============================================================================
--- limal-branches/mc-devel/limal-ca-mgm/src/limal/ca-mgm/BasicConstraintsExtension.hpp (original)
+++ limal-branches/mc-devel/limal-ca-mgm/src/limal/ca-mgm/BasicConstraintsExtension.hpp Sat Jul 3 13:27:18 2010
@@ -95,12 +95,12 @@
* @return Array with error messages. If this Array is empty this
* object is valid
*/
- virtual std::vectorblocxx::String verify() const;
+ virtual std::vectorstd::string verify() const;
/**
* Return the content of this object for debugging
*/
- virtual std::vectorblocxx::String dump() const;
+ virtual std::vectorstd::string dump() const;
private:
blocxx::COWIntrusiveReference<BasicConstraintsExtImpl> m_impl;
Modified: limal-branches/mc-devel/limal-ca-mgm/src/limal/ca-mgm/BitExtensions.hpp
URL: http://svn.opensuse.org/viewcvs/limal/limal-branches/mc-devel/limal-ca-mgm/src/limal/ca-mgm/BitExtensions.hpp?rev=2675&r1=2674&r2=2675&view=diff
==============================================================================
--- limal-branches/mc-devel/limal-ca-mgm/src/limal/ca-mgm/BitExtensions.hpp (original)
+++ limal-branches/mc-devel/limal-ca-mgm/src/limal/ca-mgm/BitExtensions.hpp Sat Jul 3 13:27:18 2010
@@ -56,9 +56,9 @@
virtual void commit2Config(CA& ca, Type type) const = 0;
virtual bool valid() const = 0;
- virtual std::vectorblocxx::String verify() const = 0;
+ virtual std::vectorstd::string verify() const = 0;
- virtual std::vectorblocxx::String dump() const = 0;
+ virtual std::vectorstd::string dump() const = 0;
protected:
blocxx::COWIntrusiveReference<BitExtensionImpl> m_impl;
@@ -136,12 +136,12 @@
* @return Array with error messages. If this Array is empty this
* object is valid
*/
- virtual std::vectorblocxx::String verify() const;
+ virtual std::vectorstd::string verify() const;
/**
* Return the content of this object for debugging
*/
- virtual std::vectorblocxx::String dump() const;
+ virtual std::vectorstd::string dump() const;
private:
bool validKeyUsage(uint32_t keyUsage) const;
@@ -217,12 +217,12 @@
* @return Array with error messages. If this Array is empty this
* object is valid
*/
- virtual std::vectorblocxx::String verify() const;
+ virtual std::vectorstd::string verify() const;
/**
* Return the content of this object for debugging
*/
- virtual std::vectorblocxx::String dump() const;
+ virtual std::vectorstd::string dump() const;
};
}
Modified: limal-branches/mc-devel/limal-ca-mgm/src/limal/ca-mgm/CA.hpp
URL: http://svn.opensuse.org/viewcvs/limal/limal-branches/mc-devel/limal-ca-mgm/src/limal/ca-mgm/CA.hpp?rev=2675&r1=2674&r2=2675&view=diff
==============================================================================
--- limal-branches/mc-devel/limal-ca-mgm/src/limal/ca-mgm/CA.hpp (original)
+++ limal-branches/mc-devel/limal-ca-mgm/src/limal/ca-mgm/CA.hpp Sat Jul 3 13:27:18 2010
@@ -62,7 +62,7 @@
* @param caPasswd the password of this CA.
* @param repos directory path to the repository root
*/
- CA(const String& caName, const String& caPasswd, const String& repos=REPOSITORY);
+ CA(const std::string& caName, const std::string& caPasswd, const std::string& repos=REPOSITORY);
/**
* Destructor of CA.
@@ -81,9 +81,9 @@
*
* @return The name of the certificate file
*/
- String
- createSubCA(const String& newCaName,
- const String& keyPasswd,
+ std::string
+ createSubCA(const std::string& newCaName,
+ const std::string& keyPasswd,
const RequestGenerationData& caRequestData,
const CertificateIssueData& caIssueData);
@@ -97,8 +97,8 @@
*
* @return the name of the new request
*/
- String
- createRequest(const String& keyPasswd,
+ std::string
+ createRequest(const std::string& keyPasswd,
const RequestGenerationData& requestData,
Type requestType);
@@ -113,8 +113,8 @@
*
* @return the name of the certificate
*/
- String
- issueCertificate(const String& requestName,
+ std::string
+ issueCertificate(const std::string& requestName,
const CertificateIssueData& issueData,
Type certType);
@@ -129,8 +129,8 @@
*
* @return the name of the certificate
*/
- String
- createCertificate(const String& keyPasswd,
+ std::string
+ createCertificate(const std::string& keyPasswd,
const RequestGenerationData& requestData,
const CertificateIssueData& certificateData,
Type type);
@@ -148,7 +148,7 @@
*
*/
void
- revokeCertificate(const String& certificateName,
+ revokeCertificate(const std::string& certificateName,
const CRLReason& crlReason = CRLReason());
/**
@@ -170,7 +170,7 @@
*
* @return the name of the request
*/
- String
+ std::string
importRequestData(const ca_mgm::ByteBuffer& request,
FormatType formatType = E_PEM);
@@ -183,8 +183,8 @@
*
* @return the name of the request
*/
- String
- importRequest(const String& requestFile,
+ std::string
+ importRequest(const std::string& requestFile,
FormatType formatType = E_PEM);
@@ -275,7 +275,7 @@
* <li>status (The status of the certificate: "valid", "revoked", "expired")</li>
* </ul>
*/
- std::vector >
+ std::vector >
getCertificateList();
@@ -297,7 +297,7 @@
* <li>date</li>
* </ul>
*/
- std::vector >
+ std::vector >
getRequestList();
@@ -320,7 +320,7 @@
* @return the request data
*/
RequestData
- getRequest(const String& requestName);
+ getRequest(const std::string& requestName);
/**
* Parse a certificate and return the data.
@@ -331,7 +331,7 @@
* @return the certificate data
*/
CertificateData
- getCertificate(const String& certificateName);
+ getCertificate(const std::string& certificateName);
/**
@@ -368,7 +368,7 @@
* @return the private key of the CA in PEM format
*/
ca_mgm::ByteBuffer
- exportCAKeyAsPEM(const String& newPassword);
+ exportCAKeyAsPEM(const std::string& newPassword);
/**
* Return the CA private key in DER format.
@@ -393,7 +393,7 @@
* @return the data in PKCS12 format
*/
ca_mgm::ByteBuffer
- exportCAasPKCS12(const String& p12Password,
+ exportCAasPKCS12(const std::string& p12Password,
bool withChain = false);
@@ -409,7 +409,7 @@
*
*/
ca_mgm::ByteBuffer
- exportCertificate(const String& certificateName,
+ exportCertificate(const std::string& certificateName,
FormatType exportType);
/**
@@ -427,9 +427,9 @@
* @return the private key of the certificate in PEM format
*/
ca_mgm::ByteBuffer
- exportCertificateKeyAsPEM(const String& certificateName,
- const String& keyPassword,
- const String& newPassword);
+ exportCertificateKeyAsPEM(const std::string& certificateName,
+ const std::string& keyPassword,
+ const std::string& newPassword);
/**
* Return the certificate private key in DER format.
@@ -442,8 +442,8 @@
* @return the private key in DER format
*/
ca_mgm::ByteBuffer
- exportCertificateKeyAsDER(const String& certificateName,
- const String& keyPassword);
+ exportCertificateKeyAsDER(const std::string& certificateName,
+ const std::string& keyPassword);
/**
* Return the certificate in PKCS12 format.
@@ -460,9 +460,9 @@
* @return the data in PKCS12 format
*/
ca_mgm::ByteBuffer
- exportCertificateAsPKCS12(const String& certificateName,
- const String& keyPassword,
- const String& p12Password,
+ exportCertificateAsPKCS12(const std::string& certificateName,
+ const std::string& keyPassword,
+ const std::string& p12Password,
bool withChain = false);
/**
@@ -486,7 +486,7 @@
*
*/
void
- deleteRequest(const String& requestName);
+ deleteRequest(const std::string& requestName);
/**
* Delete the specified certificate together with the corresponding
@@ -500,7 +500,7 @@
*
*/
void
- deleteCertificate(const String& certificateName,
+ deleteCertificate(const std::string& certificateName,
bool requestToo = true);
@@ -534,9 +534,9 @@
* @return true if the certificate is valid, otherwise false.
*/
bool
- verifyCertificate(const String& certificateName,
+ verifyCertificate(const std::string& certificateName,
bool crlCheck = true,
- const String& purpose = String("any"));
+ const std::string& purpose = std::string("any"));
/**
* Return the current config object
@@ -565,11 +565,11 @@
*
*/
static void
- createRootCA(const String& caName,
- const String& caPasswd,
+ createRootCA(const std::string& caName,
+ const std::string& caPasswd,
const RequestGenerationData& caRequestData,
const CertificateIssueData& caIssueData,
- const String& repos=REPOSITORY);
+ const std::string& repos=REPOSITORY);
/**
@@ -585,11 +585,11 @@
*
*/
static void
- importCA(const String& caName,
+ importCA(const std::string& caName,
const ca_mgm::ByteBuffer& caCertificate,
const ca_mgm::ByteBuffer& caKey,
- const String& caPasswd = String(),
- const String& repos=REPOSITORY);
+ const std::string& caPasswd = std::string(),
+ const std::string& repos=REPOSITORY);
/**
* Get a list of available CAs
@@ -597,10 +597,10 @@
*
* @param repos the path to the repository root directory
*
- * @return Array of Strings of available CAs
+ * @return Array of std::strings of available CAs
*/
- static std::vectorblocxx::String
- getCAList(const String& repos=REPOSITORY);
+ static std::vectorstd::string
+ getCAList(const std::string& repos=REPOSITORY);
/**
* Return a table of the available CAs and its issuer.
@@ -619,8 +619,8 @@
*
* @return a list of lists of the available CAs
*/
- static std::listblocxx::String >
- getCATree(const String& repos=REPOSITORY);
+ static std::liststd::string >
+ getCATree(const std::string& repos=REPOSITORY);
/**
* Get a CertificateIssueData object with current signing default
@@ -632,7 +632,7 @@
* @return a CertificateIssueData object with the current defaults
*/
static CertificateIssueData
- getRootCAIssueDefaults(const String& repos=REPOSITORY);
+ getRootCAIssueDefaults(const std::string& repos=REPOSITORY);
/**
* Get a RequestGenerationData object with current request default
@@ -644,7 +644,7 @@
* @return a RequestGenerationData object with the current defaults
*/
static RequestGenerationData
- getRootCARequestDefaults(const String& repos=REPOSITORY);
+ getRootCARequestDefaults(const std::string& repos=REPOSITORY);
/**
@@ -663,10 +663,10 @@
*
*/
static void
- deleteCA(const String& caName,
- const String& caPasswd,
+ deleteCA(const std::string& caName,
+ const std::string& caPasswd,
bool force = false,
- const String& repos = REPOSITORY);
+ const std::string& repos = REPOSITORY);
private:
blocxx::COWIntrusiveReference<CAImpl> m_impl;
@@ -698,7 +698,7 @@
*
* @return the name of the config file
*/
- String
+ std::string
initConfigFile();
/**
Modified: limal-branches/mc-devel/limal-ca-mgm/src/limal/ca-mgm/CAConfig.hpp
URL: http://svn.opensuse.org/viewcvs/limal/limal-branches/mc-devel/limal-ca-mgm/src/limal/ca-mgm/CAConfig.hpp?rev=2675&r1=2674&r2=2675&view=diff
==============================================================================
--- limal-branches/mc-devel/limal-ca-mgm/src/limal/ca-mgm/CAConfig.hpp (original)
+++ limal-branches/mc-devel/limal-ca-mgm/src/limal/ca-mgm/CAConfig.hpp Sat Jul 3 13:27:18 2010
@@ -36,7 +36,7 @@
{
class CAConfigImpl;
-
+
/**
* Class for reading and writing the openssl.cnf
*/
@@ -47,45 +47,45 @@
/**
* Create a new object from <b>file</b>
*/
- CAConfig(const String &file);
+ CAConfig(const std::string &file);
~CAConfig();
/**
* Set a new value in Section <b>section</b> with the Key <b>key</b>.
*/
void
- setValue(const String §ion, const String &key, const String &value);
+ setValue(const std::string §ion, const std::string &key, const std::string &value);
/**
* Delete the Key <b>key</b> in Section <b>section</b>
*/
void
- deleteValue(const String §ion, const String &key);
+ deleteValue(const std::string §ion, const std::string &key);
/**
* Get the value of Section <b>section</b> with the Key <b>key</b>.
*/
- String
- getValue(const String §ion, const String &key) const;
+ std::string
+ getValue(const std::string §ion, const std::string &key) const;
/**
* Check if Key <b>key</b> in Section <b>section</b> exists.
*/
bool
- exists(const String §ion, const String &key) const;
+ exists(const std::string §ion, const std::string &key) const;
/**
* Return a List of all Keys in Section <b>section</b>.
*/
- std::listblocxx::String
- getKeylist(const String §ion) const;
+ std::liststd::string
+ getKeylist(const std::string §ion) const;
/**
* Copy all Keys and values from Section <b>srcSection</b> to
* Section <b>destSection</b>.
*/
void
- copySection(const String &srcSection, const String &destSection);
+ copySection(const std::string &srcSection, const std::string &destSection);
/**
* Clone this object
@@ -93,14 +93,14 @@
* @param file a new filename for this object
*/
CAConfig*
- clone(const String &file);
+ clone(const std::string &file);
/**
* return current filename
*/
- String
+ std::string
filename() const;
-
+
void dump();
@@ -110,7 +110,7 @@
CAConfig();
CAConfig(const CAConfig&);
CAConfig& operator=(const CAConfig&);
-
+
class CASection;
void dumpTree(CASection *section, int level = 0);
@@ -120,7 +120,7 @@
*/
void validateAndFix();
};
-
+
}
#endif //LIMAL_CA_CONFIG_HPP
Modified: limal-branches/mc-devel/limal-ca-mgm/src/limal/ca-mgm/CRLData.hpp
URL: http://svn.opensuse.org/viewcvs/limal/limal-branches/mc-devel/limal-ca-mgm/src/limal/ca-mgm/CRLData.hpp?rev=2675&r1=2674&r2=2675&view=diff
==============================================================================
--- limal-branches/mc-devel/limal-ca-mgm/src/limal/ca-mgm/CRLData.hpp (original)
+++ limal-branches/mc-devel/limal-ca-mgm/src/limal/ca-mgm/CRLData.hpp Sat Jul 3 13:27:18 2010
@@ -34,36 +34,36 @@
class RevocationEntryImpl;
class CRLDataImpl;
-
+
class RevocationEntry {
public:
RevocationEntry();
RevocationEntry(const RevocationEntry& entry);
virtual ~RevocationEntry();
-
+
#ifndef SWIG
RevocationEntry&
operator=(const RevocationEntry& entry);
#endif
-
- String
+
+ std::string
getSerial() const;
time_t
getRevocationDate() const;
-
+
CRLReason
getReason() const;
virtual bool
valid() const;
-
- virtual std::vectorblocxx::String
+
+ virtual std::vectorstd::string
verify() const;
- virtual std::vectorblocxx::String
+ virtual std::vectorstd::string
dump() const;
protected:
@@ -87,70 +87,70 @@
operator=(const CRLData& data);
#endif
-
+
int32_t
getVersion() const;
-
- String
+
+ std::string
getFingerprint() const;
-
+
time_t
getLastUpdateDate() const;
-
+
time_t
getNextUpdateDate() const;
-
+
DNObject
getIssuerDN() const;
-
+
SigAlg
getSignatureAlgorithm() const;
-
- String
+
+ std::string
getSignatureAlgorithmAsString() const;
-
+
ca_mgm::ByteBuffer
getSignature() const;
-
+
X509v3CRLExts
getExtensions() const;
-
- std::map
+
+ std::map
getRevocationData() const;
-
+
RevocationEntry
- getRevocationEntry(const String& oid);
+ getRevocationEntry(const std::string& oid);
/**
* Return the CRL data as human readable text.
* (Format may change)
*/
- String
+ std::string
getCRLAsText() const;
/**
* Return the CRL extensions as human readable text.
* (Format may change)
*/
- String
+ std::string
getExtensionsAsText() const;
-
+
virtual bool
valid() const;
-
- virtual std::vectorblocxx::String
+
+ virtual std::vectorstd::string
verify() const;
- virtual std::vectorblocxx::String
+ virtual std::vectorstd::string
dump() const;
protected:
blocxx::COWIntrusiveReference<CRLDataImpl> m_impl;
CRLData();
-
- std::vectorblocxx::String
- checkRevocationData(const std::map& rd) const;
+
+ std::vectorstd::string
+ checkRevocationData(const std::map& rd) const;
};
Modified: limal-branches/mc-devel/limal-ca-mgm/src/limal/ca-mgm/CRLDistributionPointsExtension.hpp
URL: