lldb-sys 0.0.13

Raw bindings to the LLDB C++ API. LLDB is the debugger that is part of the LLVM project and is the default system debugger on Mac OS X. Building and using this is currently slightly tricky, so be sure to see the README.md in the repository.
//===-- SBFileSpecBinding.cpp -----------------------------------*- C++ -*-===//
//
//                     The LLVM Compiler Infrastructure
//
// This file is distributed under the University of Illinois Open Source
// License. See LICENSE.TXT for details.
//
//===----------------------------------------------------------------------===//

#include "lldb/Bindings/LLDBBinding.h"
#include "lldb/API/LLDB.h"

using namespace lldb;

#ifdef __cplusplus
extern "C" {
#endif

SBFileSpecRef
CreateSBFileSpec()
{
    return reinterpret_cast<SBFileSpecRef>(new SBFileSpec());
}

SBFileSpecRef
CreateSBFileSpec2(const char *path)
{
    return reinterpret_cast<SBFileSpecRef>(new SBFileSpec(path));
}

SBFileSpecRef
CreateSBFileSpec3(const char *path, bool resolve)
{
    return reinterpret_cast<SBFileSpecRef>(new SBFileSpec(path, resolve));
}

void
DisposeSBFileSpec(SBFileSpecRef instance)
{
    delete reinterpret_cast<SBFileSpec *>(instance);
}

bool
SBFileSpecIsValid(SBFileSpecRef instance)
{
    SBFileSpec *unwrapped = reinterpret_cast<SBFileSpec *>(instance);
    return unwrapped->IsValid();
}

bool
SBFileSpecExists(SBFileSpecRef instance)
{
    SBFileSpec *unwrapped = reinterpret_cast<SBFileSpec *>(instance);
    return unwrapped->Exists();
}

bool
SBFileSpecResolveExecutableLocation(SBFileSpecRef instance)
{
    SBFileSpec *unwrapped = reinterpret_cast<SBFileSpec *>(instance);
    return unwrapped->ResolveExecutableLocation();
}

const char *
SBFileSpecGetFilename(SBFileSpecRef instance)
{
    SBFileSpec *unwrapped = reinterpret_cast<SBFileSpec *>(instance);
    return unwrapped->GetFilename();
}

const char *
SBFileSpecGetDirectory(SBFileSpecRef instance)
{
    SBFileSpec *unwrapped = reinterpret_cast<SBFileSpec *>(instance);
    return unwrapped->GetDirectory();
}

void
SBFileSpecSetFilename(SBFileSpecRef instance, const char *filename)
{
    SBFileSpec *unwrapped = reinterpret_cast<SBFileSpec *>(instance);
    unwrapped->SetFilename(filename);
}

void
SBFileSpecSetDirectory(SBFileSpecRef instance, const char *directory)
{
    SBFileSpec *unwrapped = reinterpret_cast<SBFileSpec *>(instance);
    unwrapped->SetDirectory(directory);
}

unsigned int
SBFileSpecGetPath(SBFileSpecRef instance, char *dst_path, size_t dst_len)
{
    SBFileSpec *unwrapped = reinterpret_cast<SBFileSpec *>(instance);
    return unwrapped->GetPath(dst_path, dst_len);
}

int
SBFileSpecResolvePath(const char *src_path, char *dst_path, size_t dst_len)
{
    return lldb::SBFileSpec::ResolvePath(src_path, dst_path, dst_len);
}

bool
SBFileSpecGetDescription(SBFileSpecRef instance, SBStreamRef description)
{
    SBFileSpec *unwrapped = reinterpret_cast<SBFileSpec *>(instance);
    return unwrapped->GetDescription(*reinterpret_cast<SBStream *>(description));
}

#ifdef __cplusplus
}
#endif