package com.avg.zaap.crashlibrary.publish.cap;

/**
 * This interface denotes the common behavior for the CAP helpers.
 * <p/>
 * Created by marek.osvald on 18.7.2016.
 */
public interface ICapHelper {

    /**
     * This constant serves as the hex offset prefix.
     */
    String HEX_PREFIX = "0x";

    /**
     * This constant specifies the CAP offset size.
     */
    int CAP_CRASH_ID_LENGTH = 8;

    /**
     * Returns CAP exception code from the crash code.
     *
     * @param crashCode crash code to retrieve the CAP crash ID from
     * @return CAP exception code for given crash code
     */
    String getExceptionCodeFromCrashCode(String crashCode);

    /**
     * Returns CAP faulting offset in hex format.
     *
     * @param offset faulting offset in decimal format
     * @return CAP faulting offset in hex format
     */
    String getCapFaultingHexOffset(int offset);

}
