Introduced properties

private var _file: nullable String

nitc :: CmdEntityFile :: _file

File path
private var _file_url: nullable String

nitc :: CmdEntityFile :: _file_url

URL to the file
init defaultinit(model: Model, filter: nullable ModelFilter, mentity: nullable MEntity, mentity_name: nullable String)

nitc :: CmdEntityFile :: defaultinit

fun file: nullable String

nitc :: CmdEntityFile :: file

File path
fun file=(file: nullable String)

nitc :: CmdEntityFile :: file=

File path
abstract fun file_names: Array[String]

nitc :: CmdEntityFile :: file_names

Accepted file names
fun file_url: nullable String

nitc :: CmdEntityFile :: file_url

URL to the file
fun file_url=(file_url: nullable String)

nitc :: CmdEntityFile :: file_url=

URL to the file
fun init_file: CmdMessage

nitc :: CmdEntityFile :: init_file

Init file related data
fun print_file(title: String, no_color: nullable Bool)

nitc :: CmdEntityFile :: print_file

Print file

Redefined properties

redef type SELF: CmdEntityFile

nitc $ CmdEntityFile :: SELF

Type of this instance, automatically specialized in every class
redef fun init_command: CmdMessage

nitc $ CmdEntityFile :: init_command

Initialize the command
redef fun to_html: Writable

nitc :: html_commands $ CmdEntityFile :: to_html

Render results as a HTML string
redef fun to_md: Writable

nitc :: md_commands $ CmdEntityFile :: to_md

Render results as a Markdown string

All properties

fun !=(other: nullable Object): Bool

core :: Object :: !=

Have self and other different values?
fun ==(other: nullable Object): Bool

core :: Object :: ==

Have self and other the same value?
type CLASS: Class[SELF]

core :: Object :: CLASS

The type of the class of self.
type SELF: Object

core :: Object :: SELF

Type of this instance, automatically specialized in every class
private var _file: nullable String

nitc :: CmdEntityFile :: _file

File path
private var _file_url: nullable String

nitc :: CmdEntityFile :: _file_url

URL to the file
private var _filter: nullable ModelFilter

nitc :: DocCommand :: _filter

ModelFilter to apply if any
private var _mentity: nullable MEntity

nitc :: CmdEntity :: _mentity

MEntity this command is about
private var _mentity_name: nullable String

nitc :: CmdEntity :: _mentity_name

Name of the mentity this command is about
private var _model: Model

nitc :: DocCommand :: _model

Model to retrieve data for
protected fun class_factory(name: String): CLASS

core :: Object :: class_factory

Implementation used by get_class to create the specific class.
fun class_name: String

core :: Object :: class_name

The class name of the object.
fun cmd_filter: ModelFilter

nitc :: DocCommand :: cmd_filter

Return a new filter for that command execution.
init defaultinit(model: Model, filter: nullable ModelFilter, mentity: nullable MEntity, mentity_name: nullable String)

nitc :: CmdEntityFile :: defaultinit

init defaultinit(model: Model, filter: nullable ModelFilter, mentity: nullable MEntity, mentity_name: nullable String)

nitc :: CmdEntity :: defaultinit

init defaultinit(model: Model, filter: nullable ModelFilter)

nitc :: DocCommand :: defaultinit

abstract fun execute(no_color: nullable Bool)

nitc :: DocCommand :: execute

fun file: nullable String

nitc :: CmdEntityFile :: file

File path
fun file=(file: nullable String)

nitc :: CmdEntityFile :: file=

File path
abstract fun file_names: Array[String]

nitc :: CmdEntityFile :: file_names

Accepted file names
fun file_url: nullable String

nitc :: CmdEntityFile :: file_url

URL to the file
fun file_url=(file_url: nullable String)

nitc :: CmdEntityFile :: file_url=

URL to the file
fun filter: nullable ModelFilter

nitc :: DocCommand :: filter

ModelFilter to apply if any
protected fun filter=(filter: nullable ModelFilter)

nitc :: DocCommand :: filter=

ModelFilter to apply if any
fun get_class: CLASS

core :: Object :: get_class

The meta-object representing the dynamic type of self.
fun hash: Int

core :: Object :: hash

The hash code of the object.
fun http_init(req: HttpRequest): CmdMessage

nitc :: DocCommand :: http_init

Init the command from an HTTPRequest
init init

core :: Object :: init

fun init_command: CmdMessage

nitc :: DocCommand :: init_command

Initialize the command
fun init_file: CmdMessage

nitc :: CmdEntityFile :: init_file

Init file related data
fun init_mentity: CmdMessage

nitc :: CmdEntity :: init_mentity

Initialize the command mentity.
fun inspect: String

core :: Object :: inspect

Developer readable representation of self.
protected fun inspect_head: String

core :: Object :: inspect_head

Return "CLASSNAME:#OBJECTID".
intern fun is_same_instance(other: nullable Object): Bool

core :: Object :: is_same_instance

Return true if self and other are the same instance (i.e. same identity).
fun is_same_serialized(other: nullable Object): Bool

core :: Object :: is_same_serialized

Is self the same as other in a serialization context?
intern fun is_same_type(other: Object): Bool

core :: Object :: is_same_type

Return true if self and other have the same dynamic type.
fun mentity: nullable MEntity

nitc :: CmdEntity :: mentity

MEntity this command is about
fun mentity=(mentity: nullable MEntity)

nitc :: CmdEntity :: mentity=

MEntity this command is about
fun mentity_name: nullable String

nitc :: CmdEntity :: mentity_name

Name of the mentity this command is about
fun mentity_name=(mentity_name: nullable String)

nitc :: CmdEntity :: mentity_name=

Name of the mentity this command is about
fun model: Model

nitc :: DocCommand :: model

Model to retrieve data for
protected fun model=(model: Model)

nitc :: DocCommand :: model=

Model to retrieve data for
private intern fun native_class_name: CString

core :: Object :: native_class_name

The class name of the object in CString format.
intern fun object_id: Int

core :: Object :: object_id

An internal hash code for the object based on its identity.
fun output

core :: Object :: output

Display self on stdout (debug only).
intern fun output_class_name

core :: Object :: output_class_name

Display class name on stdout (debug only).
fun parser_init(arg: String, options: CmdOptions): CmdMessage

nitc :: DocCommand :: parser_init

Initialize the command from the CommandParser data
fun print_file(title: String, no_color: nullable Bool)

nitc :: CmdEntityFile :: print_file

Print file
fun serialization_hash: Int

core :: Object :: serialization_hash

Hash value use for serialization
intern fun sys: Sys

core :: Object :: sys

Return the global sys object, the only instance of the Sys class.
fun to_html: Writable

nitc :: DocCommand :: to_html

Render results as a HTML string
abstract fun to_json: nullable Serializable

nitc :: DocCommand :: to_json

Return a JSON Serializable representation of self results
abstract fun to_jvalue(env: JniEnv): JValue

core :: Object :: to_jvalue

fun to_md: Writable

nitc :: DocCommand :: to_md

Render results as a Markdown string
fun to_s: String

core :: Object :: to_s

User readable representation of self.
package_diagram nitc::CmdEntityFile CmdEntityFile nitc::CmdEntity CmdEntity nitc::CmdEntityFile->nitc::CmdEntity nitc::DocCommand DocCommand nitc::CmdEntity->nitc::DocCommand ...nitc::DocCommand ... ...nitc::DocCommand->nitc::DocCommand nitc::CmdEntityFileContent CmdEntityFileContent nitc::CmdEntityFileContent->nitc::CmdEntityFile nitc::CmdLicenseFile CmdLicenseFile nitc::CmdLicenseFile->nitc::CmdEntityFile nitc::CmdContribFile CmdContribFile nitc::CmdContribFile->nitc::CmdEntityFile nitc::CmdLicenseFileContent CmdLicenseFileContent nitc::CmdLicenseFileContent->nitc::CmdEntityFileContent nitc::CmdLicenseFileContent->nitc::CmdLicenseFile nitc::CmdContribFileContent CmdContribFileContent nitc::CmdContribFileContent->nitc::CmdEntityFileContent nitc::CmdContribFileContent->nitc::CmdContribFile nitc::CmdLicenseFileContent... ... nitc::CmdLicenseFileContent...->nitc::CmdLicenseFileContent nitc::CmdContribFileContent... ... nitc::CmdContribFileContent...->nitc::CmdContribFileContent

Ancestors

abstract class DocCommand

nitc :: DocCommand

Documentation command
interface Object

core :: Object

The root of the class hierarchy.

Parents

class CmdEntity

nitc :: CmdEntity

A command about a MEntity

Children

class CmdContribFile

nitc :: CmdContribFile

Cmd that finds the contributing file related to an mentity
class CmdLicenseFile

nitc :: CmdLicenseFile

Cmd that finds the license file related to an mentity

Descendants

class CmdContribFileContent

nitc :: CmdContribFileContent

Cmd that finds the contrib file content related to an mentity
class CmdLicenseFileContent

nitc :: CmdLicenseFileContent

Cmd that finds the license file content related to an mentity

Class definitions

nitc $ CmdEntityFile
abstract class CmdEntityFile
	super CmdEntity

	# File path
	var file: nullable String = null is writable

	# Accepted file names
	fun file_names: Array[String] is abstract

	# Init file related data
	fun init_file: CmdMessage do
		var mentity = self.mentity.as(not null)

		var source_file = mentity.location.file
		if source_file == null then return throw_warning

		for file_name in file_names do
			var file = source_file.filename / file_name
			if not file.file_exists then continue
			self.file = file
			break
		end

		if file == null then return throw_warning

		return new CmdSuccess
	end

	redef fun init_command do
		var res = super
		if not res isa CmdSuccess then return res
		return init_file
	end

	fun throw_warning: CmdWarning is abstract
end
src/doc/commands/commands_ini.nit:262,1--297,3

nitc :: md_commands $ CmdEntityFile
redef class CmdEntityFile

	# URL to the file
	#
	# Can be refined in subtools.
	var file_url: nullable String = file is lazy, writable

	redef fun to_md do
		var file = self.file
		if file == null then return ""
		return "[{file.basename}]({file_url or else ""})"
	end
end
src/doc/templates/md_commands.nit:258,1--270,3

nitc :: term $ CmdEntityFile
redef class CmdEntityFile

	# Print file
	fun print_file(title: String, no_color: nullable Bool) do
		var file = self.file
		if file == null then return
		title = "{title} `{file}`:"
		if no_color == null or not no_color then
			print title.bold
		else
			print title
		end
		print ""
		print file.to_path.read_all
		print ""
	end
end
src/doc/term/term.nit:426,1--442,3

nitc :: html_commands $ CmdEntityFile
redef class CmdEntityFile
	redef fun to_html do
		var file = self.file
		if file == null then return ""

		return "<a href=\"{file_url or else ""}\">{file.basename}</a>"
	end
end
src/doc/templates/html_commands.nit:287,1--294,3