PCART  v1.4
Automated Repair of Python API Parameter Compatibility Issues
Functions
loadData Namespace Reference

Provide utility functions for loading and processing lib APIs. More...

Functions

def func (libApiObjLst, libApiName)
 Get all overloaded API strings for a given API name 获取给定API名称的所有重载API字符串 More...
 
def getAPILst (filePath)
 Parse API list from a library extraction file 从库API提取文件中解析API列表 More...
 
def lib2json (sourceFilePath, saveFilePath)
 Traverse all library API versions and consolidate into a JSON file 遍历所有版本的库API,将其整理成一个json格式的文件 More...
 
def loadLib (libName, version)
 Load the extracted definitions of lib APIs for static signature mapping 把之前抽取出来的库API加载到字典中,在项目API与库API匹配的时候需要用到 More...
 

Detailed Description

Provide utility functions for loading and processing lib APIs.

Loads pre-extracted library API definitions from LibAPIExtraction/ for static signature matching. Provides lib2json() to consolidate per-version API definitions into a single JSON file. 从LibAPIExtraction/加载预提取的库API定义用于静态签名匹配。提供lib2json() 将按版本的API定义合并为单个JSON文件。

Function Documentation

◆ func()

def loadData.func (   libApiObjLst,
  libApiName 
)

Get all overloaded API strings for a given API name 获取给定API名称的所有重载API字符串

Parameters
libApiObjLstList of API objects
libApiNameThe API name to search for
Returns
List of full API strings matching the given name

Definition at line 83 of file loadData.py.

Here is the caller graph for this function:

◆ getAPILst()

def loadData.getAPILst (   filePath)

Parse API list from a library extraction file 从库API提取文件中解析API列表

这个应该和loadlib合并到一起

Parameters
filePathPath to the extracted API definition file
Returns
(version, apiLst) Tuple of version string and list of API strings

Definition at line 99 of file loadData.py.

Here is the caller graph for this function:

◆ lib2json()

def loadData.lib2json (   sourceFilePath,
  saveFilePath 
)

Traverse all library API versions and consolidate into a JSON file 遍历所有版本的库API,将其整理成一个json格式的文件

The output JSON is keyed by API name, with each value being a list of per-version dictionaries: {APIName: [{'1.1.0': [LibAPI1,...]}, ...]}

Parameters
sourceFilePathDirectory containing per-version API extraction files
saveFilePathPath where the consolidated JSON file is saved

Definition at line 129 of file loadData.py.

Here is the call graph for this function:

◆ loadLib()

def loadData.loadLib (   libName,
  version 
)

Load the extracted definitions of lib APIs for static signature mapping 把之前抽取出来的库API加载到字典中,在项目API与库API匹配的时候需要用到

Parameters
libNameThe upgraded lib name
versionThe lib's version
Returns
tempLst The APIs' definitions
assignDict The assign dict that stores the aliases of APIs
libAPIins The built-in APIs' definitions

Definition at line 30 of file loadData.py.

Here is the caller graph for this function: