Skip to content

Commit f1ac82c

Browse files
j-piaseckimeta-codesync[bot]
authored andcommitted
Don't include private compound objects in the snapshot (#56028)
Summary: Pull Request resolved: #56028 Changelog: [Internal] Updates the snapshot generator to ignore compound objects with visibility set to `private`. Reviewed By: cortinico Differential Revision: D95913606 fbshipit-source-id: 3c5b2e0bf46e16627c3f6bdf6cd700a862f56698
1 parent a5daece commit f1ac82c

File tree

5 files changed

+51
-0
lines changed

5 files changed

+51
-0
lines changed

scripts/cxx-api/parser/main.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,9 @@ def build_snapshot(xml_dir: str) -> Snapshot:
4848
doxygen_object = compound.parse(detail_file, silence=True)
4949

5050
for compound_object in doxygen_object.compounddef:
51+
if compound_object.prot == "private":
52+
continue
53+
5154
# Check if this is an Objective-C interface by looking at the compound id
5255
# Doxygen reports ObjC interfaces as kind="class" but with id starting with "interface"
5356
is_objc_interface = (
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
class test::Clss {
2+
public void hello();
3+
}
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
/*
2+
* Copyright (c) Meta Platforms, Inc. and affiliates.
3+
*
4+
* This source code is licensed under the MIT license found in the
5+
* LICENSE file in the root directory of this source tree.
6+
*/
7+
8+
#pragma once
9+
10+
namespace test {
11+
12+
class Clss {
13+
enum class PrivateEnum {
14+
A,
15+
};
16+
17+
public:
18+
void hello();
19+
};
20+
21+
} // namespace test
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
class test::Clss {
2+
public void hello();
3+
}
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
/*
2+
* Copyright (c) Meta Platforms, Inc. and affiliates.
3+
*
4+
* This source code is licensed under the MIT license found in the
5+
* LICENSE file in the root directory of this source tree.
6+
*/
7+
8+
#pragma once
9+
10+
namespace test {
11+
12+
class Clss {
13+
struct PrivateStruct {
14+
int a;
15+
};
16+
17+
public:
18+
void hello();
19+
};
20+
21+
} // namespace test

0 commit comments

Comments
 (0)