HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
HUSD_EditRelocates.h
Go to the documentation of this file.
1 /*
2  * Copyright 2019 Side Effects Software Inc.
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  * http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  *
16  */
17 
18 #ifndef __HUSD_EditRelocates_h__
19 #define __HUSD_EditRelocates_h__
20 
21 #include "HUSD_API.h"
22 #include "HUSD_DataHandle.h"
23 #include "HUSD_Path.h"
24 #include <UT/UT_StringHolder.h>
25 #include <UT/UT_StringMap.h>
26 #include <UT/UT_Error.h>
27 
29 {
30 public:
33 
34  // Leaves existing relocate arcs in place by taking the union of existing
35  // relocates with the provided map.
36  bool setRelocates(const UT_StringMap<UT_StringHolder> &relocatesMap) const;
37 
38  // Specify the severity of errors found when validating relocates.
40  { myReportingSeverity = severity; }
42  { return myReportingSeverity; }
43 
44 private:
45  // Makes sure the specified relocate is allowed. Adds a warning and
46  // returns false if not.
47  bool validateRelocate(const HUSD_Path &from, const HUSD_Path &to) const;
48  // Helper function for the validateRelocate method that constructs and
49  // adds a warning, and always returns false.
50  bool addRelocateError(const HUSD_Path &from, const HUSD_Path &to,
51  const char *msg) const;
52 
53  HUSD_AutoWriteLock &myWriteLock;
54  UT_ErrorSeverity myReportingSeverity = UT_ERROR_NONE;
55 };
56 
57 #endif
#define HUSD_API
Definition: HUSD_API.h:31
UT_ErrorSeverity
Definition: UT_Error.h:25
UT_ErrorSeverity reportingSeverity() const
GLenum GLenum severity
Definition: glcorearb.h:2539
void setReportingSeverity(UT_ErrorSeverity severity)