Skip to content

Commit

Permalink
Add docs
Browse files Browse the repository at this point in the history
  • Loading branch information
bamx23 committed Aug 28, 2024
1 parent d2f22e7 commit ac69f28
Show file tree
Hide file tree
Showing 2 changed files with 33 additions and 4 deletions.
25 changes: 22 additions & 3 deletions Sources/KSCrashRecording/include/KSCrash.h
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,17 @@ NS_ASSUME_NONNULL_BEGIN
*/
- (BOOL)installWithConfiguration:(KSCrashConfiguration *)configuration error:(NSError **)error;

/** TODO: Add docs
/** Sets up the crash repors store.
* A call of this method is required before working with crash reports.
* The `installWithConfiguration:error:` method sets up the crash report store.

Check failure on line 132 in Sources/KSCrashRecording/include/KSCrash.h

View workflow job for this annotation

GitHub Actions / Formatting Check

Sources/KSCrashRecording/include/KSCrash.h:132:80: error: code should be clang-formatted [-Wclang-format-violations]
* You only need to call this method if you are not using the `installWithConfiguration:error:` method

Check failure on line 133 in Sources/KSCrashRecording/include/KSCrash.h

View workflow job for this annotation

GitHub Actions / Formatting Check

Sources/KSCrashRecording/include/KSCrash.h:133:103: error: code should be clang-formatted [-Wclang-format-violations]
* or want to read crash reports from a custom location.
*
* @note This method can be called multiple times, but only before `installWithConfiguration:error:` is called.
*
* @param installPath The path to the directory where the crash reports are stored. If `nil`, the default path is used.
* @param error A pointer to an NSError object. If an error occurs, this pointer is set to an actual error object.
* @return YES if the crash report store was successfully set up, NO otherwise.
*/
- (BOOL)setupReportStoreWithPath:(nullable NSString *)installPath error:(NSError **)error;

Expand All @@ -136,8 +146,9 @@ NS_ASSUME_NONNULL_BEGIN
* deleted. Once the reports are successfully sent to the server, they may be
* deleted locally, depending on the property "deleteAfterSendAll".
*
* Note: property "sink" MUST be set or else this method will call onCompletion
* with an error.
* @note A call of `setupReportStoreWithPath:error:` or `installWithConfiguration:error:` is required
* before working with crash reports.
* @note Property "sink" MUST be set or else this method will call `onCompletion` with an error.
*
* @param onCompletion Called when sending is complete (nil = ignore).
*/
Expand All @@ -147,6 +158,9 @@ NS_ASSUME_NONNULL_BEGIN
@property(nonatomic, readonly, strong) NSArray<NSNumber *> *reportIDs;

/** Get report.
*
* @note A call of `setupReportStoreWithPath:error:` or `installWithConfiguration:error:` is required
* before working with crash reports.
*
* @param reportID An ID of report.
*
Expand All @@ -155,10 +169,15 @@ NS_ASSUME_NONNULL_BEGIN
- (nullable KSCrashReportDictionary *)reportForID:(int64_t)reportID NS_SWIFT_NAME(report(for:));

/** Delete all unsent reports.
* @note A call of `setupReportStoreWithPath:error:` or `installWithConfiguration:error:` is required
* before working with crash reports.
*/
- (void)deleteAllReports;

/** Delete report.
*

Check failure on line 178 in Sources/KSCrashRecording/include/KSCrash.h

View workflow job for this annotation

GitHub Actions / Formatting Check

Sources/KSCrashRecording/include/KSCrash.h:178:3: error: code should be clang-formatted [-Wclang-format-violations]
* @note A call of `setupReportStoreWithPath:error:` or `installWithConfiguration:error:` is required
* before working with crash reports.
*
* @param reportID An ID of report to delete.
*/
Expand Down
12 changes: 11 additions & 1 deletion Sources/KSCrashRecording/include/KSCrashC.h
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,17 @@ extern "C" {
KSCrashInstallErrorCode kscrash_install(const char *appName, const char *const installPath,
KSCrashCConfiguration configuration);

/** TODO: Add docs
/** Sets up the crash repors store.
* This function is used to initialize the storage for crash reports.
* The `kscrash_install` function sets up the reports store internally.
* You only need to call this function if you are not using the `kscrash_install` function

Check failure on line 91 in Sources/KSCrashRecording/include/KSCrashC.h

View workflow job for this annotation

GitHub Actions / Formatting Check

Sources/KSCrashRecording/include/KSCrashC.h:91:91: error: code should be clang-formatted [-Wclang-format-violations]
* or want to read crash reports from a custom location.
*

Check failure on line 93 in Sources/KSCrashRecording/include/KSCrashC.h

View workflow job for this annotation

GitHub Actions / Formatting Check

Sources/KSCrashRecording/include/KSCrashC.h:93:3: error: code should be clang-formatted [-Wclang-format-violations]
* @note this function can be called multiple times, but only before `kscrash_install` is called.
*

Check failure on line 95 in Sources/KSCrashRecording/include/KSCrashC.h

View workflow job for this annotation

GitHub Actions / Formatting Check

Sources/KSCrashRecording/include/KSCrashC.h:95:3: error: code should be clang-formatted [-Wclang-format-violations]
* @param appName The name of the application. Usually it's bundle name.
* @param installPath The directory where the crash reports and related data will be stored.
* @return KSCrashInstallErrorCode indicating the result of the setup.
*/
KSCrashInstallErrorCode kscrash_setupReportsStore(const char *appName, const char *const installPath);

Expand Down

0 comments on commit ac69f28

Please sign in to comment.