/////////////////////////////////////////////////////////////////////////////// // Copyright (C) 2002-2025, Open Design Alliance (the "Alliance"). // All rights reserved. // // This software and its documentation and related materials are owned by // the Alliance. The software may only be incorporated into application // programs owned by members of the Alliance, subject to a signed // Membership Agreement and Supplemental Software License Agreement with the // Alliance. The structure and organization of this software are the valuable // trade secrets of the Alliance and its suppliers. The software is also // protected by copyright law and international treaty provisions. Application // programs incorporating this software must include the following statement // with their copyright notices: // // This application incorporates Open Design Alliance software pursuant to a license // agreement with Open Design Alliance. // Open Design Alliance Copyright (C) 2002-2025 by Open Design Alliance. // All rights reserved. // // By use of this software, its documentation or related materials, you // acknowledge and accept the above terms. /////////////////////////////////////////////////////////////////////////////// #ifndef _DAI_UTILS_H_ #define _DAI_UTILS_H_ #include "daiBuildOptions.h" #include "daiPrimitive.h" #include "OdTimeStamp.h" #include "TD_PackPush.h" namespace OdDAI { class ApplicationInstance; class Aggr; namespace Utils { /** \details Gets the instance`s ID, typename and values of the explicit attribute fields. \param pInstance [in] Instance to get data from. \returns An ANSI string that contains the instance`s ID, typename and value of the explicit attribute fields. */ DAI_EXPORT OdAnsiString getStepLine(const OdDAI::ApplicationInstance* pInstance); /** \details Gets the aggregates`s value as string. \param pAggr [in] Instance to get data from. \returns An ANSI string that contains the aggregates`s value. */ DAI_EXPORT OdAnsiString getAggrLine(const OdDAI::Aggr* pAggr); /** \details Compares two string values using the pattern matching algorithm and evaluates result of comparison to a logical value. \param targetString A string that should tested. \param patternString A string that contains pattern. \returns Logical::True if targetString matches pattern, or Logical::False if targetString doesn't match pattern; or Logical::Unknown otherwise, e.g. if pattern is incorrect and can not be parsed. \remarks Pattern matching characters table: @ Matches any letter ^ Matches any upper case letter ? Matches any character & Matches remainder of string # Matches any digit $ Matches a substring terminated by a space character or end-of-string * Matches any number of characters (including letters and digits) \ Begins a pattern escape sequence (for pattern matching characters compare, '@' LIKE '\@' = TRUE) ! Negation character (used with the other characters) */ DAI_EXPORT Logical stringLike(const char *targetString, const char *patternString); /** \details Gets the OdTCKind that defines kinds of an object. \param kind [in] OdTCKind value to be converted to string. \returns An ANSI string that contains converted into string value of kind. */ DAI_EXPORT const OdAnsiString& tcKindToString(OdTCKind kind); /** \details Prints contents of time stamp as a string according to the specified format. \param timeStamp [in] A time stamp to print. \param sFormat [in] A string that contains the format. \param str [out] A string that contains the result. */ DAI_EXPORT void sdaiStrFTime(OdTimeStamp& timeStamp, const OdString& sFormat, OdString& str); } } #include "TD_PackPop.h" #endif //_DAI_UTILS_H_