The meaning of のか in a sentence that is not a question


> 俺はゆりこの自慢話をした。彼女がどれほど優しく、どれほど愛らしく、俺を想ってくれたのか。
>
> 二人は驚いたり、笑ったりしながら、話を聞いてくれた。

What does のか。add to this sentence? He's boosting about his girlfriend to other
people. So I don't see why using のか。 at the end?




のか is basically a literary-style question marker. か is a question marker, and
の is an explanatory-の.

> これは何か？  
>  これは何なのか？
>
> What is it?

In this context, however, this person is not asking a question. So you can
think of this sentence as a
[体言止め](https://japanese.stackexchange.com/q/14524/5010) sentence where an
[embedded question](https://japanese.stackexchange.com/q/13034/5010) is not
actually embedded but used as a sentence on its own.

> 彼女がどれほど優しく、どれほど愛らしく、俺を想ってくれたのか(について自慢話をした)。
>
> (I bragged about) How kindly and how adorably she thought of me.

