Menu

- Learn
- Documentation
  - Language Reference
  - Library Reference
  - Command-line Reference
  - Feature Overview
  - Articles
- Packages
- Community
  - Blog
  - Orgs using D
  - Twitter
  - Forums
  - IRC
  - Wiki
  - GitHub
  - Issues
  - Get involved
  - Foundation
  - Donate
- Resources
  - Books
  - Tutorials
  - Tools
  - Editors
  - IDEs
  - Visual D
  - Acknowledgments
  - D Style
  - Glossary
  - Sitemap

Search
Report a bug
If you spot a problem with this page, click here to create a Bugzilla issue.
Improve this page
Quickly fork, edit online, and submit a pull request for this page. Requires a signed-in GitHub account. This works well for small changes. If you'd like to make larger changes you may want to consider using a local clone.

# ddmd.access

Compiler implementation of the D programming language.
Authors:
Walter Bright
License:
Boost License 1.0

Source: access.d

Prot `getAccess`(AggregateDeclaration `ad`, Dsymbol `smember`);
  Return Prot access for Dsymbol `smember` in this declaration.
static bool `isAccessible`(Dsymbol `smember`, Dsymbol `sfunc`, AggregateDeclaration `dthis`, AggregateDeclaration `cdscope`);
  Helper function for checkAccess()
  Returns:
  `false` is not accessible `true` is accessible
bool `checkAccess`(AggregateDeclaration `ad`, Loc `loc`, Scope* `sc`, Dsymbol `smember`);
  Do access check for member of this class, this class being the type of the 'this' pointer used to access `smember`. Returns `true` if the member is not accessible.
bool `isFriendOf`(AggregateDeclaration `ad`, AggregateDeclaration `cd`);
  Determine if this is the same or friend of `cd`.
bool `hasPackageAccess`(Scope* `sc`, Dsymbol `s`);
  Determine if scope `sc` has package level access to `s`.
bool `hasProtectedAccess`(Scope* `sc`, Dsymbol `s`);
  Determine if scope `sc` has protected level access to cd.
bool `hasPrivateAccess`(AggregateDeclaration `ad`, Dsymbol `smember`);
  Determine if `smember` has access to private members of this declaration.
bool `checkAccess`(Loc `loc`, Scope* `sc`, Expression `e`, Declaration `d`);
  Check access to `d` for expression `e`.`d` Returns `true` if the declaration is not accessible.
bool `checkAccess`(Loc `loc`, Scope* `sc`, Package `p`);
  Check access to package/module `p` from scope `sc`.
  Parameters:

  Loc `loc` | source location for issued error message
  Scope* `sc` | scope from which to access to a fully qualified package name
  Package `p` | the package/module to check access for

  Returns:
  `true` if the package is not accessible.
  Because a global symbol table tree is used for imported packages/modules, access to them needs to be checked based on the imports in the scope chain (see https://issues.dlang.org/show_bug.cgi?id=313).
bool `symbolIsVisible`(Module `mod`, Dsymbol `s`);
  Check whether symbols `s` is visible in `mod`.
  Parameters:

  Module `mod` | lookup origin
  Dsymbol `s` | symbol to check for visibility

  Returns:
  `true` if `s` is visible in `mod`
bool `symbolIsVisible`(Dsymbol `origin`, Dsymbol `s`);
  Same as above, but determines the lookup module from symbols `origin`.
bool `symbolIsVisible`(Scope* `sc`, Dsymbol `s`);
  Same as above but also checks for protected symbols visible from scope `sc`. Used for qualified name lookup.
  Parameters:

  Scope* `sc` | lookup scope
  Dsymbol `s` | symbol to check for visibility

  Returns:
  `true` if `s` is visible by origin

Copyright © 1999-2017 by the D Language Foundation | Page generated by Ddoc on Fri Sep 1 12:52:29 2017