• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * Copyright (c) 2021-2024 Huawei Device Co., Ltd.
3  * Licensed under the Apache License, Version 2.0 (the "License");
4  * you may not use this file except in compliance with the License.
5  * You may obtain a copy of the License at
6  *
7  * http://www.apache.org/licenses/LICENSE-2.0
8  *
9  * Unless required by applicable law or agreed to in writing, software
10  * distributed under the License is distributed on an "AS IS" BASIS,
11  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12  * See the License for the specific language governing permissions and
13  * limitations under the License.
14  */
15 
16 #ifndef PANDA_ASSEMBLER_ASSEMBLY_FILE_LOCATION_H
17 #define PANDA_ASSEMBLER_ASSEMBLY_FILE_LOCATION_H
18 
19 namespace ark::pandasm {
20 
21 // NOLINTBEGIN(misc-non-private-member-variables-in-classes)
22 class FileLocation {
23 public:
24     std::string wholeLine; /* The line in which the field is defined */
25                            /*  Or line in which the field met, if the field is not defined */
26     size_t boundLeft = 0;
27     size_t boundRight = 0;
28     size_t lineNumber = 0;
29     bool isDefined = false;
30 
31 public:
FileLocation(std::string & fC,size_t bL,size_t bR,size_t lN,bool d)32     FileLocation(std::string &fC, size_t bL, size_t bR, size_t lN, bool d)
33         : wholeLine(std::move(fC)), boundLeft(bL), boundRight(bR), lineNumber(lN), isDefined(d)
34     {
35     }
36     ~FileLocation() = default;
37 
38     DEFAULT_MOVE_SEMANTIC(FileLocation);
39     DEFAULT_COPY_SEMANTIC(FileLocation);
40 };
41 // NOLINTEND(misc-non-private-member-variables-in-classes)
42 
43 }  // namespace ark::pandasm
44 
45 #endif  // PANDA_ASSEMBLER_ASSEMBLY_FILE_LOCATION_H
46