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  // Convert paths from relative to absolute, or vice versa.
60  SWIGOUT(%kwargs abspath;)
61  virtual std::string abspath(const char *path,
62  const char *anchor_path = nullptr) = 0;
63  SWIGOUT(%kwargs relpath;)
64  virtual std::string relpath(const char *path,
65  const char *anchor_path = nullptr) = 0;
66  virtual std::string normpath(const char *path) = 0;
67 
68  // Collapse a file path if it starts with the expanded form of one of our
69  // standard env vars (HIP, JOB).
70  SWIGOUT(%kwargs collapseCommonVars;)
71  virtual std::string collapseCommonVars(const char *path,
72  const std::vector<std::string> &vars =
73  std::vector<std::string>()) = 0;
74 
75  // Access to CE_Snippet, allows processing of opencl snippets.
76  /// Returns set of bindings specified with @BIND commands.
77  virtual std::vector<std::map<std::string,hboost::any> > oclExtractBindings(const char *code) = 0;
78 
79  virtual std::string patternRename(const char *str, const char* find, const char* replace) = 0;
80  SWIGOUT(%kwargs patternMatch;)
81  virtual bool patternMatch(const char *pattern, const char* str, bool ignore_case=false, bool path_match=false) = 0;
82 };
83 
84 #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 * string
Definition: glcorearb.h:814
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:349
#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
FMT_CONSTEXPR auto find(Ptr first, Ptr last, T value, Ptr &out) -> bool
Definition: core.h:2089