HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
HOM_text.h
Go to the documentation of this file.
1 /*
2  * PROPRIETARY INFORMATION. This software is proprietary to
3  * Side Effects Software Inc., and is not to be reproduced,
4  * transmitted, or disclosed in any way without written permission.
5  *
6  * COMMENTS:
7  */
8 
9 #ifndef __HOM_text_h__
10 #define __HOM_text_h__
11 
12 #include "HOM_API.h"
13 #include "HOM_Defines.h"
14 #include <vector>
15 #include <map>
16 
17 SWIGOUT(%rename(text) HOM_text;)
18 
20 {
21 public:
22  virtual ~HOM_text()
23  { }
24 
25  virtual std::string __repr__() = 0;
26 
27  virtual std::string expandString(const char *str,
28  bool expand_tilde = true) = 0;
29  virtual std::string expandStringAtFrame(const char *str, double frame,
30  bool expand_tilde = true) = 0;
31  virtual std::string expandHuskFilePath(const char *str,
32  double frame_start = 1.0,
33  double frame_inc = 1.0,
34  int frame_idx = 0) = 0;
35  virtual std::string incrementNumberedString(const char *str) = 0;
36 
37  // Use Punycode-like scheme to encode and decode strings with special
38  // characters into a form that can be used as a variable, attribute, or
39  // parameter name.
40  virtual std::string encode(const char *varname) = 0;
41  virtual std::string decode(const char *varname) = 0;
42  virtual std::string encodeAttrib(const char *attribname) = 0;
43  virtual std::string decodeAttrib(const char *attribname) = 0;
44  virtual std::string encodeParm(const char *parmname) = 0;
45  virtual std::string decodeParm(const char *parmname) = 0;
46 
47  virtual std::string _obfuscate(const char *text) = 0;
48  virtual std::string _deobfuscate(const char *text) = 0;
49 
50  // Expose the UT_String forceAlphaNumeric method.
51  virtual std::string alphaNumeric(const char *str) = 0;
52 
53  // Expose the UT_String forceValidVariableName method.
54  SWIGOUT(%kwargs variableName;)
55  virtual std::string variableName(
56  const char *str,
57  const char *safe_chars = nullptr) = 0;
58 
59  // Expose the UT_String compareVersionString method.
60  virtual int compareVersionString(const char *str1, const char *str2) = 0;
61 
62  // Convert paths from relative to absolute, or vice versa.
63  SWIGOUT(%kwargs abspath;)
64  virtual std::string abspath(const char *path,
65  const char *anchor_path = nullptr) = 0;
66  SWIGOUT(%kwargs relpath;)
67  virtual std::string relpath(const char *path,
68  const char *anchor_path = nullptr,
69  bool allow_relative_path_from_root = true) = 0;
70  virtual std::string normpath(const char *path) = 0;
71 
72  // Collapse a file path if it starts with the expanded form of one of our
73  // standard env vars (HIP, JOB).
74  SWIGOUT(%kwargs collapseCommonVars;)
75  virtual std::string collapseCommonVars(const char *path,
76  const std::vector<std::string> &vars =
77  std::vector<std::string>()) = 0;
78 
79  // Access to CE_Snippet, allows processing of opencl snippets.
80  /// Returns set of bindings specified with #bind commands.
81  virtual std::vector<std::map<std::string,hboost::any> > oclExtractBindings(const char *code) = 0;
82  /// Returns the value specified with #runover
83  virtual std::string oclExtractRunOver(const char *code) = 0;
84 
85  virtual std::string patternRename(const char *str, const char* find, const char* replace) = 0;
86  SWIGOUT(%kwargs patternMatch;)
87  virtual bool patternMatch(const char *pattern, const char* str, bool ignore_case=false, bool path_match=false) = 0;
88 };
89 
90 #endif
std::string ignore_case(std::string item)
Helper function to allow ignore_case to be passed to IsMember or Transform.
Definition: CLI11.h:3456
GLsizei const GLchar *const * path
Definition: glcorearb.h:3341
#define SWIGOUT(x)
Definition: HOM_Defines.h:24
string __repr__(VtArray< T > const &self)
Definition: wrapArray.h:312
FMT_CONSTEXPR auto find(Ptr first, Ptr last, T value, Ptr &out) -> bool
Definition: core.h:2138
#define HOM_API
Definition: HOM_API.h:13
std::string OIIO_UTIL_API replace(string_view str, string_view pattern, string_view replacement, bool global=false)
GLushort pattern
Definition: glad.h:2583
OIIO_UTIL_API bool rename(string_view from, string_view to, std::string &err)
virtual ~HOM_text()
Definition: HOM_text.h:22