# For example, if asdcplib version 1.0.0 were modified to accomodate changes
# in file format, and if no changes were made to AS_DCP.h, the new version would be
# 1.0.1. If changes were also required in AS_DCP.h, the new version would be 1.1.1.
-AC_INIT([asdcplib], [1.4.24], [asdcplib@cinecert.com])
+AC_INIT([asdcplib], [1.4.25], [asdcplib@cinecert.com])
AC_CONFIG_AUX_DIR([build-aux])
AC_CONFIG_SRCDIR([src/KM_error.h])
//
static PathCompList_t&
-s_PathMakeCanonical(PathCompList_t& CList, char separator, bool is_absolute)
+s_PathMakeCanonical(PathCompList_t& CList, bool is_absolute)
{
PathCompList_t::iterator ci, ri; // component and removal iterators
{
PathCompList_t CList;
bool is_absolute = PathIsAbsolute(Path, separator);
- s_PathMakeCanonical(PathToComponents(Path, CList, separator), separator, is_absolute);
+ s_PathMakeCanonical(PathToComponents(Path, CList, separator), is_absolute);
if ( is_absolute )
return ComponentsToAbsolutePath(CList, separator);
CList.push_back(cwd_buf);
CList.push_back(Path);
- return ComponentsToAbsolutePath(s_PathMakeCanonical(CList, separator, true), separator);
+ return ComponentsToAbsolutePath(s_PathMakeCanonical(CList, true), separator);
}
//
return Basename + "." + Extension;
}
+//
+std::string
+Kumu::PathJoin(const std::string& Path1, const std::string& Path2, char separator)
+{
+ return Path1 + separator + Path2;
+}
+
+//
+std::string
+Kumu::PathJoin(const std::string& Path1, const std::string& Path2, const std::string& Path3, char separator)
+{
+ return Path1 + separator + Path2 + separator + Path3;
+}
+
+//
+std::string
+Kumu::PathJoin(const std::string& Path1, const std::string& Path2,
+ const std::string& Path3, const std::string& Path4, char separator)
+{
+ return Path1 + separator + Path2 + separator + Path3 + separator + Path4;
+}
+
//
Kumu::PathList_t&
Kumu::FindInPaths(const IPathMatch& Pattern, const Kumu::PathList_t& SearchPaths,
bool PathsAreEquivalent(const std::string& lhs, const std::string& rhs); // true if paths point to the same filesystem entry
// Returns free space and total space available for the given path
- Result_t FreeSpaceForPath(const std::string& path, Kumu::fsize_t& free_space, Kumu::fsize_t& total_space);
+ Result_t FreeSpaceForPath(const std::string& path, Kumu::fsize_t& free_space, Kumu::fsize_t& total_space);
// split and reassemble paths as lists of path components
PathCompList_t& PathToComponents(const std::string& Path, PathCompList_t& CList, char separator = '/'); // removes '//'
std::string PathGetExtension(const std::string& Path); // returns everything in the right-most element following the right-most '.'
std::string PathSetExtension(const std::string& Path, const std::string& Extension); // empty extension removes '.' as well
+ std::string PathJoin(const std::string& Path1, const std::string& Path2, char separator = '/');
+ std::string PathJoin(const std::string& Path1, const std::string& Path2, const std::string& Path3, char separator = '/');
+ std::string PathJoin(const std::string& Path1, const std::string& Path2,
+ const std::string& Path3, const std::string& Path4, char separator = '/');
+
//------------------------------------------------------------------------------------------
// Path Search
//
void
-Kumu::SyslogLogSink::WriteEntry(const LogEntry& e)
+Kumu::SyslogLogSink::WriteEntry(const LogEntry& Entry)
{
int priority;
- switch ( e.Type )
+ switch ( Entry.Type )
{
case Kumu::LOG_ALERT: priority = SYSLOG_ALERT; break;
case Kumu::LOG_CRIT: priority = SYSLOG_CRIT; break;
case Kumu::LOG_DEBUG: priority = SYSLOG_DEBUG; break;
}
- syslog(priority, "%s", e.Msg.substr(0, e.Msg.size() - 1).c_str());
+ AutoMutex L(m_Lock);
+
+ if ( Entry.TestFilter(m_filter) )
+ {
+ syslog(priority, "%s", Entry.Msg.substr(0, Entry.Msg.size() - 1).c_str());
+ }
}
//
// write messages to the syslog facility
class SyslogLogSink : public ILogSink
{
+ Mutex m_Lock;
KM_NO_COPY_CONSTRUCT(SyslogLogSink);
SyslogLogSink();
MyTreeHandler* docHandler = new MyTreeHandler(this);
ErrorHandler* errHandler = (ErrorHandler*)docHandler;
parser->setDocumentHandler(docHandler);
+ parser->setErrorHandler(docHandler);
try
{
bool
Kumu::XMLElement::ParseString(const std::string& document)
{
- DefaultLogSink().Error("asdcplib compiled without XML parser support.\n");
+ DefaultLogSink().Error("Kumu compiled without XML parser support.\n");
return false;
}