1
|
|
###########################################################################/**
|
2
|
|
# @RdocClass RspComment
|
3
|
|
#
|
4
|
|
# @title "The RspComment class"
|
5
|
|
#
|
6
|
|
# \description{
|
7
|
|
# @classhierarchy
|
8
|
|
#
|
9
|
|
# An RspComment is an @see "RspConstruct" that represents an RSP comment,
|
10
|
|
# which are of format \code{<\%-- ... --\%>}, \code{<\%--- ... ---\%>}
|
11
|
|
# and so on. They can also be so called "empty" RSP comments of format
|
12
|
|
# \code{<\%-\%>}, \code{<\%--\%>}, \code{<\%---\%>} and so on.
|
13
|
|
# }
|
14
|
|
#
|
15
|
|
# @synopsis
|
16
|
|
#
|
17
|
|
# \arguments{
|
18
|
|
# \item{str}{A @character string.}
|
19
|
|
# \item{...}{Not used.}
|
20
|
|
# }
|
21
|
|
#
|
22
|
|
# \section{Fields and Methods}{
|
23
|
|
# @allmethods
|
24
|
|
# }
|
25
|
|
#
|
26
|
|
# @author
|
27
|
|
#
|
28
|
|
# @keyword internal
|
29
|
|
#*/###########################################################################
|
30
|
|
setConstructorS3("RspComment", function(str=character(), ...) {
|
31
|
1
|
extend(RspConstruct(str), "RspComment")
|
32
|
|
})
|
33
|
|
|
34
|
|
|
35
|
|
#########################################################################/**
|
36
|
|
# @RdocMethod getComment
|
37
|
|
#
|
38
|
|
# @title "Gets the comment"
|
39
|
|
#
|
40
|
|
# \description{
|
41
|
|
# @get "title".
|
42
|
|
# }
|
43
|
|
#
|
44
|
|
# @synopsis
|
45
|
|
#
|
46
|
|
# \arguments{
|
47
|
|
# \item{...}{Not used.}
|
48
|
|
# }
|
49
|
|
#
|
50
|
|
# \value{
|
51
|
|
# Returns a @character string.
|
52
|
|
# }
|
53
|
|
#
|
54
|
|
# @author
|
55
|
|
#
|
56
|
|
# \seealso{
|
57
|
|
# @seeclass
|
58
|
|
# }
|
59
|
|
#*/#########################################################################
|
60
|
|
setMethodS3("getComment", "RspComment", function(comment, ...) {
|
61
|
0
|
as.character(comment)
|
62
|
|
})
|
63
|
|
|
64
|
|
|
65
|
|
setMethodS3("asRspString", "RspComment", function(object, ...) {
|
66
|
1
|
body <- unclass(object)
|
67
|
1
|
suffixSpecs <- attr(object, "suffixSpecs")
|
68
|
|
|
69
|
1
|
fmtstr <- "%s%s"
|
70
|
1
|
fmtstr <- paste(escFmtStr(.rspBracketOpen), fmtstr, escFmtStr(.rspBracketClose), sep="")
|
71
|
|
|
72
|
1
|
s <- sprintf(fmtstr, body, suffixSpecs)
|
73
|
1
|
RspString(s)
|
74
|
|
})
|