The OpenD Programming Language

reflectGetDocs

Members

Aliases

reflectGetDocs
alias reflectGetDocs(alias symbol) = .reflectGetDocs!(target, symbol)
immutable(ReflectDoc!target)[] reflectGetDocs(T value)

Functions

Examples

enum E
{
    @reflectDoc("alpha")
    a,
    @reflectDoc!"C#"("Beta", reflectUnittest!"C#"("some c# code"))
    @reflectDoc("beta")
    b,
    c,
}

alias Doc = ReflectDoc!null;
alias CSDoc = ReflectDoc!"C#";

static assert(reflectGetDocs!null(E.a) == [Doc("alpha")]);
static assert(reflectGetDocs!"C#"(E.b) == [CSDoc("Beta", reflectUnittest!"C#"("some c# code"))]);
static assert(reflectGetDocs!null(E.b) == [Doc("beta")]);
static assert(reflectGetDocs!null(E.c) is null);

struct S
{
    @reflectDoc("alpha")
    @reflectDoc!"C#"("Alpha")
    int a;
}

static assert(reflectGetDocs!(null, S.a) == [Doc("alpha")]);
static assert(reflectGetDocs!("C#", S.a) == [CSDoc("Alpha")]);

import std.conv: to;
static assert(CSDoc("Beta", reflectUnittest!"C#"("some c# code")).to!string == "Beta\nExample usage:\nsome c# code");

Meta