Page MenuHome

Cleanup: Move RNA path functions into own C++ file
ClosedPublic

Authored by Julian Eisel (Severin) on Jul 25 2022, 6:17 PM.

Details

Summary

Adds rna_path.cc and RNA_path.h. We could include the header in RNA_access.h for convenience, rather than including it in a bunch of files that already include the latter. But I think we should at least keep the path functions in a separate file.

Motivation
rna_access.c is a quite big file, which makes it rather hard and inconvenient to navigate. RNA path functions form a nicely coherent unit that can stand well on its own, so it makes sense to split them off to mitigate the problem. Moreover, I was looking into refactoring the quite convoluted/overloaded rna_path_parse(), and found that some C++ features may help greatly with
that. There are a number of improvements we could do to the RNA path code, and C++ seems to provide a number of helpful ways to do this. E.g. having paths as objects with safe interfaces, rather than mere character arrays seems like a good direction to go.

Diff Detail

Repository
rB Blender

Event Timeline

Julian Eisel (Severin) requested review of this revision.Jul 25 2022, 6:17 PM
Julian Eisel (Severin) created this revision.
Julian Eisel (Severin) edited the summary of this revision. (Show Details)Jul 25 2022, 6:21 PM
Julian Eisel (Severin) added a project: Core.
Julian Eisel (Severin) edited the summary of this revision. (Show Details)Jul 25 2022, 6:32 PM
This revision is now accepted and ready to land.Jul 25 2022, 6:35 PM
Julian Eisel (Severin) edited the summary of this revision. (Show Details)Jul 25 2022, 7:01 PM
Campbell Barton (campbellbarton) added inline comments.
source/blender/makesrna/RNA_path.h
19–26

This can be moved under the \file as the files description as the text is no longer part of RNA access.

Julian Eisel (Severin) marked an inline comment as done.Jul 29 2022, 4:58 PM